Reverse the Order Contents are Listed


ls -r

If you don't like the default alphabetical order that -l uses, you can reverse it by adding -r (or --reverse).

$ ls -lar ~/ -rw-------  8800 2005-10-18 19:55 .bash_history drwxr-xr-x   592 2005-10-18 11:22 .Azureus -rw-r--r--  1026 2005-09-25 00:11 .audacity drwx------    72 2005-09-16 19:14 .aptitude drwxr-xr-x   200 2005-07-28 01:31 alias 


Note

Keep in mind that this is -r, not -R.-r means reverse, but -R means recursive.


When you use -l, the output is sorted alphabetically based on the name of the files and folders; the addition of -r reverses the output, but it is still based on the filename. Keep in mind that you can add -r virtually any time you use ls if you want to reverse the default output of the command and options you're inputting.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net