Common CentOS learning commands ls
Command Format and directory Processing Command ls
Command Format: Command [-options] [parameters]
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-a: view files in the local directory (including hidden files)
# Ls-l display the detailed information of the file
1rootroot1208 August 6: 22anaconw.ks.cfg
1rootroot24772, December 6, December 30: 22install. log
1rootroot7690 August 6: 21install. log. syslog
Root owner root group 7690 File Size
The followingLs-lh is to convert the file size byte display into Windows
12345[root@localhost ~]# ls -lhTotal usage 44 K-rw-------. 1 root root <spanstyle="font-size: 16px;"><strong><spanstyle="color: #800080;">1.2K</span></strong></span> December 3 06:22 anaconda-ks.cfg-Rw-r --. 1 root 25 K December 3 06:22 install. log-Rw-r --. 1 root 7.6 K December 3 06:21 install. log. syslog1.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
12[root@localhost ~]# ls -lhd /etcDrwxr-xr-x. 102 root 12 K December 15 06:36/etcLs-lhd/etc is to viewThe size of the etc directory Instead of viewing all contents in the ect directory.
12[root@localhost ~]# ls -i795111 anaconda-ks.cfg 786436 install.log 786437 install.log.syslog# Ls-I view the ID number of each file