- List files using ls with no option
ls with no option list files and directories in a bare format where we won’t be able to view
details like file types, size, modified date and time, permission and links etc.
ls
- List Files with option -l
Here, ls -l (-l is a character not one) shows file or directory, size, modified date and time, file
or folder name and owner of the file and its permission.
ls -l
- View Hidden Files
List all files including hidden files starting with “ls -a”.
ls -a
- List Files with Human Readable Format with option -lh
With a combination of -lh option, it shows sizes in a human-readable format.
ls -lh
- 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.
ls -F
- List Files in Reverse Order
The following command with ls -r option displays files and directories in reverse order.
ls -r
- Recursively list Subdirectories
ls -R option will list very long listing directory trees. See an example of the output of the
command.
ls -R
- Reverse Output Order
With the combination of -ltr it will show the latest modification file or directory date as last.
ls -ltr
ls -ltra
- Sort Files by File Size
With the combination of -lS displays file size in order, it will display big at first.
ls -lS
ls -lSa
- The display Inode number of File or Directory
We can see some numbers printed before the file/directory name. With -i options list
file/directory with an inode number.
ls -ia
Top comments (0)