2 ms·
> Doing cat from left to right helps readability - it's important. People may balk because it's unfamiliar, but this is syntactically legal: < logs.txt so
by adrianmonk 7y ago
> Doing cat from left to right helps readability - it's important.
People may balk because it's unfamiliar, but this is syntactically legal:
< logs.txt sort | uniq > /dev/null
That is, the redirection customarily goes at the end, but it doesn't have to.
EDIT: Also, in this specific case, the "sort" command can take a file argument, so you can also do this:
sort logs.txt | uniq > /dev/null