Tried to make a log of the latest 20 dirs in a folder, and had some trouble with reversing the output, i wanted the newest dir at the top, the answer made me laugh.
Tac is like cat, but reversed.
For those interested: ls -tr /home/user | tail -n 20 | tac > latestdirs.log
Lämna ett svar