ls
-la – for listing folder contents, where thel
option stands for long listing and thea
option stands for all files (including the ones starting with a dot)touch
– for creating an empty text filecd
– for changing directories, both in absolute and relative termspwd
– for showing the current directorymkdir
andrm
– for creating and deleting a file or directorycp
andmv
– for copying or moving a file or a directoryln
– for working with soft and hard links
The ls
command can be used in a recursive mode with a capital letter R
option, which means starting to list the content of a folder from that folder onward and going into all its subfolders.
Example:
$ ls -laR /etc/
By using the R
option, we instructed the ls
command to do its job in recursive mode.
We can also use ls
to display the content of the folder and sort the output by using the last modified time:
$ ls -lat
By using the t option, we instructed the ls
command to sort the output.