Understanding UNIX / Linux filesystem Inodes
admin
2023-02-03 23:00:09
0

Theinode (index node)is a fundamental concept in the Linux and UNIX filesystem. Each object in the filesystem is represented by an inode. But what are the objects? Let us try to understand it in simple words. Each and every file under Linux (and UNIX) has following attributes:

=> File type (executable, block special etc)
=> Permissions (read, write etc)
=> Owner
=> Group
=> File Size
=> File access, change and modification time (remember UNIX or Linux never stores file creation time, this is favorite question asked in UNIX/Linux sys admin job interview)
=> File deletion time
=> Number of links (soft/hard)
=> Extended attribute such as append only orno one can delete fileincludingroot user (immutability)
=> Access Control List (ACLs)

All the above information stored in an inode. In short the inode identifies the file and its attributes (as above) . Each inode is identified by a unique inode number within the file system. Inode is also know as index number.

inode definition

An inode is a data structure on a traditional Unix-style file system such as UFS or ext3. An inode stores basic information about a regular file, directory, or other file system object.

How do I see file inode number?

You can use ls -i command to see inode number of file
$ ls -i /etc/passwd
Sample Output

32820 /etc/passwd

You can also use stat command to find out inode number and its attribute:
$ stat /etc/passwdOutput:

File: `/etc/passwd'
Size: 1988            Blocks: 8          IO Block: 4096   regular file
Device: 341h/833d       Inode: 32820       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2005-11-10 01:26:01.000000000 +0530
Modify: 2005-10-27 13:26:56.000000000 +0530
Change: 2005-10-27 13:26:56.000000000 +0530

Inode application

Many commands used by system administrators in UNIX / Linux operating systems often give inode numbers to designate a file. Let us see he practical application of inode number. Type the following commands:
$ cd /tmp
$ touch \"la*
$ ls -l

Now try to remove file "la*

You can't, to remove files having created with control characters or characters which are unable to be input on a keyboard or special character such as ?, * ^ etc. You have to useinode number to removefile. This is fourth part of "UnderstandingUNIX/Linux filesystem, continue reading rest of the Understanding Linux file system series (this is part IV):


相关内容

热门资讯

终于明白“红豆炸/金/花怎么装... 家人们!今天小编来为大家解答红豆炸/金/花透视挂怎么安装这个问题咨询软件客服徽9784099的挂在哪...
今日重大发现“丁丁麻将有挂吗?... 您好:丁丁麻将这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9784099】很多玩家在这款游戏...
【第一资讯】“情怀莆仙究竟有挂... 网上科普关于“情怀莆仙有没有挂”话题很是火热,小编也是针对情怀莆仙作*弊开挂的方法以及开挂对应的知识...
玩家分享攻略“福建天天开心怎么... 您好:福建天天开心这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9784099】很多玩家在这款...
终于了解“八闽掌上麻将是不是有... 您好:八闽掌上麻将这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在这款...
【第一资讯】“宝马互娱到底是不... 有 亲,根据资深记者爆料宝马互娱是可以开挂的,确实有挂(咨询软件无需打开...
终于懂了“西兵互娱炸/金/花有... 家人们!今天小编来为大家解答西兵互娱炸/金/花透视挂怎么安装这个问题咨询软件客服徽9784099的挂...
最新引进“新道游究竟有挂吗?”... 您好:新道游这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9752949】很多玩家在这款游戏中...
终于懂了“微乐云南麻将开挂神器... 网上科普关于“微乐云南麻将有没有挂”话题很是火热,小编也是针对微乐云南麻将作*弊开挂的方法以及开挂对...
终于明白“新众亿牌九可以开挂吗... 有 亲,根据资深记者爆料新众亿牌九是可以开挂的,确实有挂(咨询软件无需打...