UNIX philosophy says: do one thing and do it well. Make programs that handle text, because that is a universal interface.The sort command, at least GNU sort, has an -o option to output to a file instead of stdout. Why is, say, sort foobar -o whatever useful when I could just sort foobar > whatever?
Why is sort -o useful?
sort;unix philosophy
It is not just GNU sort that has it.  BSD sort has it too.  And as to why?(I thought it was a good question too...)From the man page:The argument given is the name of an output file to be usedinstead of the standard output.  This file can be the same as oneof the input files.You can't go to the same file with redirection, the output redirection wipes the file.To further clarify, if I wanted to sort a file and put the sorted results in the same place I might think to try sort < foo > foo.  Except the output redirection truncates the file foo in preparation to receive the output.   And then there is nothing to sort.  Without -o the way to do it would be sort < foo > bar ; mv bar foo.  I assume the -o option does something similar without making you have to worry about it.