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

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.

主站蜘蛛池模板: 苗栗市| 陆川县| 高清| 始兴县| 溧水县| 东海县| 读书| 盐边县| 抚宁县| 合肥市| 南华县| 法库县| 宁远县| 太保市| 怀仁县| 三穗县| 穆棱市| 福安市| 揭东县| 晋江市| 雷波县| 玉龙| 石景山区| 汝南县| 唐河县| 泰顺县| 怀柔区| 凤翔县| 龙南县| 固原市| 武宁县| 武隆县| 南郑县| 临湘市| 梅河口市| 碌曲县| 丰原市| 德州市| 尼木县| 玉门市| 石景山区|