Properties of a file or directory under Linux
[Email protected] ~]# ls-l-rw-r--r--. 1 root root 9119 Nov 09:29 install.logdrwxr-xr-x. 2 root root 4096 Mar 13:50 test
#列出当前所有的目录 ^d represents a type that begins with D
[Email protected] ~]# ls-l |grep ' ^d ' drwxr-xr-x. 2 root root 4096 Mar 16:10 12drwxr-xr-x. 2 root root 4096 Mar 16:19 13drwxr-xr-x. 3 root root 4096 Mar 13:57 test
Ls-f can be simple to distinguish between file types, directory words Plus/Ordinary files are not added
[Email protected]~]# ls-fl-rwxr-xr-x. 1 root root 363 Dec 15:35 11.sh*drwxr-xr-x. 2 root root 4096 Mar 16:10 12/-rw-------. 1 root root 1090 Nov 09:29 anaconda-ks.cfg
ls-la/etc/| grep ' ^d ' | wc-l The entire command is to list the number of directories in/etc directory
^ for WC Statistics starting with D
[Email protected]~]# ls-la/etc/|grep ' ^d ' |wc-l60
Linux File types:
D directory file has x permission to CD into the directory, there is Rx can cd+ls, with WX to RM, MV
B-Block device files (USB drive, disk)
-Normal file
L Link File
C Character file
P Pipeline File | grep | Pipeline
s socket file (socket) interprocess communication, similar to TCP/IP
hosts on the internet typically run multiple service software, while providing several services. Each service opens a socket and binds to a port, and the different ports correspond to different services.
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>
Linux file link number (inode) Unique identifier
hard connections can be used multiple files can correspond to the same inode
#test目录本身的Inode value 3 represents 3 files using the same inode
[email protected] ~]# Ls-li
391511 drwxr-xr-x. 3 root root 4096 Mar 13:50 test
#当前目录的inode
[email protected] ~]# ls-ali test
391511 drwxr-xr-x. 3 root root 4096 Mar 13:57 .
390913 Dr-xr-x---. 3 root root 4096 Mar 17 13:50.
391512 Drwxr-xr-x. 2 root root 4096 Mar 17 13:57 1
#查看test/1 Directory
[email protected] ~]# Ls-ali test/1/
391512 Drwxr-xr-x. 2 root root 4096 Mar 17 13:57.
391511 drwxr-xr-x. 3 root root 4096 Mar 13:57 .
From the inode above, you can see that the inode appears three times:
1. The directory itself
2. In the test/catalogue. (hidden) ' Current directory
3, TEST/1 directory of: (previous level) ' Upper level directory
This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://8802265.blog.51cto.com/8792265/1622384
Properties of files and directories under Linux