% mafft input.txt > output.txt
The full path name (/usr/local/bin/) may be necessary, if it is not in your command-search path.
% /usr/local/bin/mafft input.txt > output.txt