如何找到任何目录的索引节点?


15

在Google上,我找不到任何可以帮助我回答这个问题的东西。我想它正在传递其他参数给ls -i

Answers:


25

是的,参数-i将打印ls命令列出的每个文件或目录的索引节点号。当您要打印目录的索引节点号时,我建议使用参数-d仅列出目录。要在目录/ path / to / dir中打印索引节点号,请使用以下命令行:

ls -id /path/to/dir

来自man ls

   -d, --directory
          list  directory entries instead of contents, and do not derefer‐
          ence symbolic links
   -i, --inode
          print the index number of each file


3

您可以使用-i选项找到文件和目录的索引节点

ls -id /home/user/dir

您可以获取系统消耗的索引节点的信息

df -hi

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.