ls command mean List the names of files. In this tutorial, How to use the ls command in Linux with Examples.
![ls command in Linux with Examples](https://www.devopsroles.com/wp-content/uploads/2019/01/ls-command-in-Linux-with-Examples.jpg)
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
![ls command in Linux with Examples](https://www.devopsroles.com/wp-content/uploads/2022/06/image-7.png)
List only directory with option ‘-ld’
ls -ld /home/vagrant
![List only directory with option '-ld'](https://www.devopsroles.com/wp-content/uploads/2022/06/image-8.png)
List file recursively
ls -lR /home/vagrant/kubekey
![List file recursively](https://www.devopsroles.com/wp-content/uploads/2022/06/image-9.png)
List files with size.
ls -s /home/vagrant/
![List files with size.](https://www.devopsroles.com/wp-content/uploads/2022/06/image-10.png)
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!