ls

Overview

The ls command lists directory contents. It is one of the most commonly used commands in a Linux environment. ls is similar to dir in a Windows environment.

List File/Folder Size

You can use the -l option to list file and folder sizes:

By default, ls outputs file/folder sizes in bytes, no matter how large the file. To improve on this when using ls, use the -h flag to enable “human readable” output.

Finding What Shell You Are Using

You can use the ls program along with the flag -l (use the long list format) to determine what shell program you are using (bash, dash, Bourne, e.t.c).

Type the following command:

If I was running bash, the program will output something like this:

Posted: March 26th, 2014 at 8:07 am
Last Updated on: April 27th, 2017 at 4:40 am