How to list directories in Linux

ls command is used for this purpose. You can list directories or files with ls.

 

ls

Now see the manual page for ls

 

how to show manual of ls command

 

you will get a manual page screen. I am sharing a part of this.

 

manual page of ls



Here we will discuss some of the frequently used options in ls

  1. ls –a

Purpose

It is used to show all files. Showing all files means including the hidden files.

Note: When a file name on a Linux file system starts with a dot, it is considered a hidden file and it doesn’t show up in regular file listings.

 

"ls

 

2. ls -l

Purpose

Typing ls -l (that is a letter L, not the number 1) gives you a long listing.

 

"ls

 

·         ls -h

Purpose

It shows the numbers (file sizes) in a more human-readable format. You can use different combination as well. E.g. lh,hl, -h –l, -h.

 

Below I am showing you an example:

 

ls -lh

 

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here