I need to be able to alphabetically sort the output of find before piping it to a command. Entering | sort | between didn't work, so what could I do?find folder1 folder2 -name *.txt -print0 | xargs -0 myCommand
Sorting the output of find?
shell;find;sort;xargs
Leave the newlines in (just a standard -print), then sort, then remove the newlines:find | sort | sed ':a;N;$!ba;s/\n/ /g' | xargs -0 yourcommand