The Linux ls command is used to display the content in the specified working directory (list the files and subdirectories contained in the current working directory ).
Syntax
Ls [-alrtAFR] [name...]
Parameters:
- -A: displays all files and directories. (if the file name or directory name starts with "." is specified in ls, it is regarded as a hidden file and will not be listed)
- -L in addition to the file name, the file type, permission, owner, file size, and other information are listed in detail.
- -R: Display files in reverse order (originally in alphabetical order)
- -T list files in the order of creation time
- -A is the same as-a, but does not list "." (Current Directory) and ".." (parent directory)
- -F add a symbol after the name of the listed File. For example, add "*" to the executable file and add "/" to the directory "/"
- -R if the directory contains files, the following files are listed in sequence.
Instance
List all directories under the root directory:
# Ls/
Bin dev lib media net root srv upload www
Boot etc lib64 misc opt sbin sys usr
Home lost + found mnt proc selinux tmp var
List all files whose names start with "s" in the current working directory:
Ls-ltr s *
List all the following directories and file details in the/bin directory:
Ls-lR/bin
List all files and directories in the current working directory. Add "/" After the directory name, and add "*" after the executable file name "*":
Ls-AF