Common LInux learning commands ls and linux Common commands ls
Command Format and directory Processing Command ls
Command Format:Command [-Option] [parameter]
For example:Ls-la/etc
Note:
1) Some commands do not follow this format
2) when there are multiple options, you can write them together
3) Simplified options and complete options
-A equals to -- all
PS: in Linux, "." indicates a hidden file.
Directory processing command: ls |
Command Name: |
Ls |
Command: |
List |
Command path: |
/Bin/ls |
Execution permission: |
All users |
Function Description: |
Show directory files |
Syntax: |
Ls option [-ald] [file or directory] |
|
-A: displays all files, including hidden files. |
|
-L detailed information display |
|
-D. view directory properties. |
# Ls-View files in the current directory (including hidden files)
# Ls-lDisplays detailed information about a file.
1 root 1208 December 3 06:22 anaconda-ks.cfg
1 root 24772 December 3 06:22 install. log
1 root 7690 December 3 06:21 install. log. syslog
Root owner root group 7690 File Size
The followingLs-lhIs to convert the file size byte display into Windows
[Root @ localhost ~] # Total ls-lh usage 44K-rw -------. 1 root1.2 KDecember 3 06:22 anaconda-ks.cfg-rw-r -- r --. 1 root 25 K December 3 06:22 install. log-rw-r --. 1 root 7.6 K December 3 06:21 install. log. syslog.
1.2 K and 7690 represent one meaning, but when ls-lh is used, the file size will be changed to the K, M, G representation we are familiar with, rather than the byte representation.
-Rw-r --
-File type (-binary file d indicates directory l indicates soft link file)
Rw-r --
U g o
U owner g owner group o others
PS: r read w write x Execute
[Root @ localhost ~] # Ls-lhd/etcdrwxr-xr-x. 102 root 12 K 06:36/etc
Ls-lhd/etcYesEtcThe directory size instead of viewing all contents in the ect directory.
[root@localhost ~]# ls -i795111 anaconda-ks.cfg 786436 install.log 786437 install.log.syslog
# Ls-IView the ID of each file