0
0
Linux CLIscripting~20 mins

Inodes concept in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Understanding Inodes in Linux
📖 Scenario: You are learning how Linux stores information about files using inodes. Each file has an inode that holds metadata like file size, permissions, and location on disk. Understanding inodes helps you manage files better.
🎯 Goal: Learn how to check inode numbers of files and count files using inode-related commands in Linux.
📋 What You'll Learn
Use the ls -i command to list files with their inode numbers
Create a directory and files inside it
Use the find command to count files by inode
Display the inode number of a specific file
💡 Why This Matters
🌍 Real World
Understanding inodes helps in file system management, troubleshooting disk space issues, and recovering files.
💼 Career
System administrators and developers use inode knowledge to manage Linux servers and optimize storage.
Progress0 / 4 steps
1
Create a directory and files
Create a directory called myfiles and inside it create two empty files named file1.txt and file2.txt using the mkdir and touch commands.
Linux CLI
Need a hint?

Use mkdir myfiles to create the folder, then cd myfiles to enter it, and touch file1.txt file2.txt to create the files.

2
List files with inode numbers
Use the ls -i command inside the myfiles directory to list the files along with their inode numbers.
Linux CLI
Need a hint?

Run ls -i to see inode numbers next to each file name.

3
Find and count files by inode
Use the find . -inum command to find files by their inode number. First, get the inode number of file1.txt using ls -i file1.txt, then use find . -inum [inode_number] to find it. Replace [inode_number] with the actual number.
Linux CLI
Need a hint?

Use command substitution to store the inode number, then use find . -inum with that number.

4
Display inode number of a file
Print the inode number of file2.txt using the ls -i file2.txt command.
Linux CLI
Need a hint?

Use ls -i file2.txt to show its inode number and file name.