Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

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
podcaststodo
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.

  • + Share This
  • 🔖 Save To Your Account