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

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.

主站蜘蛛池模板: 调兵山市| 神木县| 田林县| 吉木乃县| 竹溪县| 阿克| 长武县| 广元市| 芦溪县| 德兴市| 肥城市| 阿尔山市| 巴彦淖尔市| 夏津县| 萨嘎县| 商丘市| 延吉市| 达孜县| 宿州市| 垫江县| 通州市| 札达县| 拜城县| 浮山县| 三门县| 宁津县| 六枝特区| 东乌珠穆沁旗| 永胜县| 庄河市| 大理市| 虎林市| 乌兰浩特市| 宝山区| 望奎县| 利津县| 泸溪县| 崇文区| 宁晋县| 怀仁县| 静乐县|