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 Contents As a Comma-Separated List

ls -m

Another option for those who can’t stand columns of any form, whether it’s one or many, is the -m option (or --format=commas).

$ ls -m ~/
alias, bin, Desktop, documents, iso, music, pictures, podcasts, program_files, src, todo, videos

Think of the m in -m as a mnemonic for comma, and it is easier to remember the option. Of course, this option is also useful if you’re writing a script and need the contents of a directory in a comma-separated list, but that’s a more advanced use of a valuable option.

  • + Share This
  • 🔖 Save To Your Account