View a List of Contents in a Single Column


ls -1

So far, you've just been working with the default outputs of ls. Notice that ls prints the contents of the directory in alphabetical columns, with a minimum of two spaces between each column for readability. But what if you want to see the contents in a different manner?

If multiple columns aren't your thing, you can instead view the results of the ls command as a single column using, logically enough, ls -1 (or ls --format=single-column).

$ ls -1 ~/ bin Desktop documents iso music pictures src videos 


This listing can get out of hand if you have an enormous number of items in a directory, and more so if you use the recursive option as well, as in ls -1R ~/. Be prepared to press Ctrl+c to cancel the command if a list is streaming down your terminal with no end in sight.



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