官术网_书友最值得收藏!

Displaying file inode number

There are two commands you can use to view the inode number of a file:

  1. ls -i file
  2. stat file

For example, to view the inode number of facts.txt, you can run the command ls -i facts.txt:

elliot@ubuntu-linux:~$ ls -i facts.txt 
924555 facts.txt

And it will spit out the inode number for you. You can also use the stat command:

elliot@ubuntu-linux:~$ stat facts.txt 
File: facts.txt
Size: 173 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 924555 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ tom) Gid: ( 1000/ tom)
Access: 2019-05-08 13:41:16.544000000 -0600
Modify: 2019-05-08 12:50:44.112000000 -0600
Change: 2019-05-08 12:50:44.112000000 -0600
Birth: -

The stat command doesn't just list the inode number of a file; it also lists all the file attributes as you can see from the command output.

主站蜘蛛池模板: 成安县| 泾源县| 彭泽县| 申扎县| 平定县| 佳木斯市| 丰顺县| 新沂市| 临安市| 万载县| 虎林市| 莱州市| 上杭县| 彰武县| 新营市| 故城县| 昭通市| 安化县| 邯郸市| 延津县| 宁蒗| 沂南县| 黄陵县| 耿马| 正阳县| 酒泉市| 泰兴市| 和顺县| 泗阳县| 信阳市| 北票市| 遂溪县| 静海县| 唐河县| 左贡县| 彩票| 宁乡县| 保山市| 阜城县| 常熟市| 黑河市|