Comments on 16 Practical Examples of Linux LS command for Beginners

Whenever it's required to take a look at the contents of a directory on the command line in Linux, ls is the command that's used. It lists the contents sorted in alphabetical order. While that's the tool's basic usage, it offers a plethora of features (in the form of command line options) that help you in several circumstances. In this tutorial, we will discuss the usage of some of these command line options through easy to understand examples.

4 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Brandon

This is my preferred: ls -goF --group-directories-first

 

Use this almost exclusively. Would like to have the available: free space AND total files/total directories (in current directory) available on the bottom of the listing but don't know how to do that. Similar to the way the DOS dir command worked.

 

By: grifter

one thing I find useful: ls -shSr

Sort files after size, biggest at bottom 

By: Raghavan alias Saravanan Muthu

Awesome tutorial. Came from the System Code Geeks subsription emailer. The 15th one awesome - using the --format=commas option. Thank you :)

Keep up the good work.

By: niaz

can you please sent me that example

 

how to Run the command ls --color in a directory with a few files and

directories.