List or ls command is one of the most frequently used command in Linux. In this article, we’ll be discussing a basic list or ls command.
1. List files using ls with no option
Without an option, we won’t be able to view details like file types, size, modified date and time, permission and links etc.
2. List files with option –l
With -l option we would be able to view details like file types, size, modified date and time, permission and links etc.
3. List files with option –a or view hidden files
With -l option we would be able to View Hidden Files including hidden file starting with ‘.’.
4. List Files with Human Readable Format with option -lh
With a combination of -lh option, we can shows sizes in a human-readable format.
5. List Files and Directories with ‘/’ Character at the end
Using -F option with ls command will add the ‘/’ Character at the end of each directory.
6. List Files in Reverse Order
7. Recursively list Sub-Directories
ls -R option will list very long listing directory trees.
8. Sort Files by File Size
With a combination of -lS displays file size in order, will display big in size first.
For more details read this article Practical applications of ls command