1. PWD: View the current path
2, ls: View the file under the current path
"Can use-lih combination"
-D: see only the current directory information (directory information, LS-DL)
-L: Details of all files in the current directory
-A: Displays all files (including hidden files), preceded by any file with ".", meaning hidden files (hidden meanings: Indicates that the file is important, the administrator does not move randomly)
-a list except for "." and ".." Other than the file.
[[email protected] /]# ls -A.autofsck bin dev lib media proc sbin sys usr.autorelabel boot etc lib64 mnt ricky selinux test varbackup data1 home lost+found opt root srv tmp[[email protected] /]# ls -a. .autorelabel boot etc lib64 mnt ricky selinux test var.. backup data1 home lost+found opt root srv tmp.autofsck bin dev lib media proc sbin sys usr[[email protected] /]#
-H: Show file Size "Human readable display method"
-li all file details and display file Inode numbers (including number of hard links, third column)
-I: Displays the inode number of the file
-F: Identify different directories or files; Add a character at the end of each file to indicate the type of the file. ' @ ' means symbolic link, ' | ' Represents FIFOs, "/" for directory, "=" for sockets
[[email protected] rc3.d]# ls -F[email protected] [email protected] [email protected] [email protected] [email protected]
-P: Label directory
Append/indicator to Directories
[[email protected] /]# ls backup boot dev home lib64 media opt ricky sbin srv test usrbin data1 etc lib lost+found mnt proc root selinux sys tmp var[[email protected] /]# ls –p 在目录后面加了“/”标识backup/ data1/ home/ lost+found/ opt/ root/ srv/ tmp/bin/ dev/ lib/ media/ proc/ sbin/ sys/ usr/boot/ etc/ lib64/ mnt/ ricky/ selinux/ test var/[[email protected] /]#
-R: Reverse sort, reversed
-T: Sort by modified time
Example: LS-LRT: Reverse Sort by modification time "that is the last modification time"
[[email protected] tmp]# ls -rtl总用量 4-rw-r--r-- 1 root root 466 5月 17 05:32 rsyncd.conf-rw-r--r-- 1 root root 0 5月 18 21:01 kk-rw-r--r-- 1 root root 0 5月 18 21:02 nn[[email protected] tmp]
-S: Sort by file size
[[email protected] tmp]# ls -lS 总用量 4-rw-r--r-- 1 root root 466 5月 17 05:32 rsyncd.conf-rw-r--r-- 1 root root 0 5月 18 21:01 kk-rw-r--r-- 1 root root 0 5月 18 21:02 nn
-S: The size of the file or directory in front of each file or directory (Human readable)
[[email protected] /]# ls -s总用量 106 4 backup 4 data1 4 home 16 lost+found 4 opt 4 root 4 srv 4 tmp 4 bin 0 dev 4 lib 4 media 0 proc 12 sbin 0 sys 4 usr 2 boot 4 etc 12 lib64 4 mnt 4 ricky 4 selinux 0 test 4 var
--color 以指定颜色显示
[[email protected] /]# ls -l --color=‘auto‘【颜色自动匹配】总用量 24lrwxrwxrwx. 1 root root 7 1月 16 18:22 bin -> usr/bindr-xr-xr-x. 5 root root 4096 1月 16 18:43 bootdrwxr-xr-x. 19 root root 3120 4月 7 09:27 devdrwxr-xr-x. 137 root root 8192 4月 7 09:28 etcdrwxr-xr-x. 3 root root 19 1月 16 18:55 home
LS detailed for Linux commands (sorted by time and file size)