ls command is used for listing the contents of the current or specified directory.
ls can be used in the following ways –
| S.No. | Command | Description | Example |
| 1 | ls | Lists the folder contents | $ ls fileOne fileTwo directoryOne directoryTwo |
| 2 | ls -a | List hidden file also, with other files and directories | $ ls .hiddenFile fileOne fileTwo directoryOne directoryTwo |
| 3 | ls a* | Lists all files and directories starting with a | $ ls aLongFile aBigDirectory |
| 4 | ls -l | Lists the folder contents in long listing | $ ls -rwxr-xโx 1 userOne 18 Feb 22 08:08 fileOneย -rwxr-xr-x 1 userOne 18 Feb 22 18:08 fileTwo |
