- Learn Linux Quickly
- Ahmed AlKabary
- 136字
- 2021-06-11 18:43:52
Displaying file inode number
There are two commands you can use to view the inode number of a file:
- ls -i file
- 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.
推薦閱讀
- 微服務與事件驅動架構
- 程序員面試筆試寶典
- 圖解Java數據結構與算法(微課視頻版)
- Java技術手冊(原書第7版)
- 實戰低代碼
- Internet of Things with Intel Galileo
- Python高效開發實戰:Django、Tornado、Flask、Twisted(第3版)
- Python數據可視化之Matplotlib與Pyecharts實戰
- ArcGIS By Example
- R Deep Learning Cookbook
- JavaScript入門經典
- MySQL入門很輕松(微課超值版)
- 細說Python編程:從入門到科學計算
- jQuery for Designers Beginner's Guide Second Edition
- Node.js從入門到精通