ls 命令参数大全

1. List Files using ls with no option

ls with no option list files and directories in bare format where 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

Here, ls -l (-l is character not one) shows file or directory, size, modified date and time, file or folder name and owner of file and it’s permission.

3. View Hidden Files with option -a

List all files including hidden file starting with ‘.‘.

4. List Files with Human Readable Format with option -lh

With combination of -lh option, shows sizes in 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 each directory.

6. List Files in Reverse Order

The following command with ls -r option display files and directories in reverse order.

7. Recursively list Sub-Directories

ls -R option will list very long listing directory trees. See an example of output of the command.

8. Reverse Output Order

With combination of -ltr will shows latest modification file or directory date as last.

9. Sort Files by File Size

With combination of -lS displays file size in order, will display big in size first.

10. Display Inode number of File or Directory

We can see some number printed before file / directory name. With -i options list file / directory with inode number.

11. Shows version of ls command

Check version of ls command.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.