ls command mean List the names of files. In this tutorial, How to use the ls command in Linux with Examples.
Syntax
ls [OPTION]… [FILE]…
On the man page, the describes it
- ls – list directory contents.
- man ls – More details information about ls command.
ls command in Linux with Examples
$ ls -l
$ ls -a
$ ls
How to display file timestamps use the option ‘–time-style’
ls -l --time-style="+%Y-%m-%d %H:%M:%S" /home/vagrant
List only directory with option ‘-ld’
ls -ld /home/vagrant
List file recursively
ls -lR /home/vagrant/kubekey
List files with size.
ls -s /home/vagrant/
Conclusion
ls command is a simple command in Linux. It is the most popular in use terminal Linux list directory contents. Thank you for reading the DevopsRoles page!