Linux: the concept of an operating system file attributes (file, ls)

The concept of an operating system file attributes

[root@oldboyedu ~]# ls -li /etc/
total 1092
                      第一个部分:文件属性               第二个部分:文件名称
 34141705 d rwxr-xr-x.  3 root root      101 Mar 28 10:42 abrt
 34022854 - rw-r--r--.  1 root root       16 Mar 28 10:45 adjtime
 33590855 - rw-r--r--.  1 root root     1518 Jun  7  2013 aliases
 33554501 - rw-r--r--.  1 root root    12288 Mar 28 10:48 aliases.db
 33583487 d rwxr-xr-x.  2 root root      236 Mar 28 10:42 alternatives
 34105318 - rw-------.  1 root root      541 Apr 11  2018 anacrontab
 33862777 - rw-r--r--.  1 root root       55 Apr 11  2018 asound.conf
 34193678 d rwxr-x---.  3 root root       43 Mar 28 10:42 audisp
101181822 d rwxr-x---.  3 root root       83 Mar 28 10:48 audit
   01     02  03       04 05   06         07    08

01. Data file inode information: index node == inode

    作用: 快递从磁盘中找到数据信息
    

02. type of data file: file directory link the device file

    PS: linux系统中一切皆文件
    作用: 指明数据的文件类型

03. permission bits of information: r ead w rite read write execute execution

    作用: 控制让不同的用户对文件可以有不同的权限
             

04. Number of hard links to the file directory: a plurality of doors is similar to supermarket

    作用: 可以多个路径查看数据信息
    

05. Owned by user information (owner): data (child less than 16 years old) (owner) guardian

    作用: 文件的创建或者拥有者
    

06. Owned by group information (genus group): data (child less than 16 years old) (owner) guardian father (genus group) relatives (next door Pharaoh) other users

    作用: 文件或数据的所属用户组

07. file size information

08. Time information file

File property details - File Types

1. The concept of file types

windows: 区分文件的类型 扩展名
linux:   不用扩展名来区分文件类型

2. linux file system type distinguishing method

a color-coded
b using the attribute information to distinguish
  ls -l 
  d rwxr-xr-x. 3 root root 100 Apr  1 11:00 oldboy01
  d rwxr-xr-x. 2 root root   6 Apr 12 11:19 oldboy.jpg
  - rw-r--r--. 1 root root  35 Apr 12 08:52 oldboy.txt
  - rw-r--r--. 1 root root  18 Apr 11 10:23 oldgirl.txt
  - rw-r--r--. 1 root root   4 Apr 11 12:29 test01.txt
  - rw-r--r--. 1 root root  65 Apr 11 12:21 test.txt
c use of special commands are
  [root@oldboyedu ~]# file /oldboy/oldboy.jpg
  /oldboy/oldboy.jpg: directory
  [root@oldboyedu ~]# file /oldboy/oldboy.txt
  /oldboy/oldboy.txt: ASCII text

3. linux system common file types

   *d   -- 目录文件类型
   *-   -- 普通文件 

①. Plain text files (ordinary files can be edited directly view) text / etc / hosts --- text file

②. Binary file binary / bin / ls --- command files (not edit)

③. Data file data /tmp/etc.tar.gz --- type data file (compressed file)

   *l   -- 链接文件(快捷方式)
        创建方法: ln -s /oldboy/oldboy.txt /oldboy/oldboy_link.txt  
                          源文件             快捷方式(软链接文件)
   c/b -- 块文件/字符文件(设备文件)
          块文件: 存储的设备文件  光驱设备文件 磁盘
          字符文件: 根本停不下来的输出字符信息
   
          磁盘设备文件 /dev/sda          磁盘文件
          随机设备文件 /dev/urandom      
          输出设备文件 /dev/zero         黑洞出口文件???  磁盘分区
          输入设备文件 /dev/null         黑洞入口文件???  定时任务
          
   s   -- socket文件(网络编程)

Guess you like

Origin www.cnblogs.com/moox/p/12160300.html