ls command is used for listing the contents of the current or specified directory.

ls can be used in the following ways –

S.No.CommandDescriptionExample
1lsLists the folder contents$ ls
fileOne
fileTwo
directoryOne
directoryTwo
2ls -aList hidden file also, with other files and directories$ ls
.hiddenFile
fileOne
fileTwo
directoryOne
directoryTwo
3ls a*Lists all files and directories starting with a$ ls
aLongFile
aBigDirectory
4ls -lLists 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
Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *