jeudi 26 mars 2015

How to display only the last line of a listing ?


Supposed I make a listing and sort the files by its temporal attribute:



ls -ltr

-rwxrwxrwx 1 bla bla 4096 Feb 01 20:10 foo1
-rwxrwxrwx 1 bla bla 4096 Feb 01 20:12 foo2
.
.
.
-rwxrwxrwx 1 bla bla 4096 Mar 05 13:25 foo1000


What should I add behind the ls -ltr in a pipe chain in order to obtain only the last line of the listing ? I know there are sed and awk, but I do not know how to use them, I only know what they can do.



Aucun commentaire:

Enregistrer un commentaire