Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
hheedat
V2EX  ›  Linux

Linux 按照 inode 查文件的链接个数,为何查不到足量的文件?

  •  
  •   hheedat · Jan 3, 2020 · 3529 views
    This topic created in 2516 days ago, the information mentioned may be changed or developed.

    首先,我自己建立两个文件

    $ touch file1
    $ ln file1 file2
    $ ll -i
    
    1946247743 -rw-rw-r--  2 worker worker    0 Jan  3 19:43 file1
    1946247743 -rw-rw-r--  2 worker worker    0 Jan  3 19:43 file2
    1678585980 drwxrwxr-x 51 worker worker 4096 Aug 16  2018 website
    
    $ sudo find / -inum 1946247743
    /home/services/file1
    /home/services/file2
    
    $ sudo find / -inum 1678585980
    /home/services/website
    
    

    1946247743 可以找到对应的两个文件

    但是 1678585980 显示有 51 个链接个数,但是却只能找到一个文件,这是为啥?

    proxy

    3 replies  •  2020-01-04 09:51:23 +08:00
    codehz
    codehz
    Jan 3, 2020❤️1
    1
    因为它是目录啊,每个子目录都会有一个..
    hheedat
    hheedat
    OP
    Jan 3, 2020
    2
    @codehz 试了下还真是,看来我没有理解这个的原理,我找资料再看看吧[捂脸]
    scriptB0y
    scriptB0y
    Jan 4, 2020 via iPhone
    3
    贴一个我之前写的 https://www.kawabangga.com/posts/3561
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2818 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 04:17 · PVG 12:17 · LAX 20:17 · JFK 23:17
    ♥ Do have faith in what you're doing.