Reverse dir listing

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


Publicerat

i

av

Etiketter:

Kommentarer

Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *