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

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.

主站蜘蛛池模板: 顺昌县| 噶尔县| 会理县| 临武县| 株洲县| 卢湾区| 澄江县| 阿坝县| 利辛县| 西充县| 新绛县| 京山县| 夹江县| 延川县| 绍兴县| 威海市| 榆树市| 旌德县| 新巴尔虎左旗| 翁源县| 河源市| 奉贤区| 荔波县| 南皮县| 京山县| 南安市| 方山县| 西乌珠穆沁旗| 西和县| 沈丘县| 炉霍县| 宣武区| 江源县| 磐安县| 固阳县| 桐城市| 扎鲁特旗| 永定县| 中牟县| 库伦旗| 河池市|