I have a file's inode but not its path. How do I find it?

Quick Linux Tip #50:

Try: sudo find / -inum 524290 2>/dev/null

Info: Every file has a unique inode per filesystem. Running find -inum locates all directory entries pointing to that specific inode number.

Examples:

  • $ find / -inum 524290 2>/dev/null  # Find file by inode number
  • $ ls -i file.txt  # Display inode number for a file
  • $ find /home -samefile /home/linuxteck/original.txt  # Find all matching hardlinks

Note: Hardlinks share the exact same inode number; symlinks do not. Files are deleted only when their link count drops to 0.




LinuxTeck.com
linuxteck@ubuntu:~$ sudo find / -inum 524290 2>/dev/null
/home/linuxteck/Documents/important.pdf
/home/linuxteck/Backup/important_link.pdf

linuxteck@ubuntu:~$ stat /home/linuxteck/Documents/important.pdf
  File: /home/linuxteck/Documents/important.pdf
  Size: 234567        Blocks: 464          IO Block: 4096   regular file
Device: 801h/2049d    Inode: 524290       Links: 2
Access: (0644/-rw-r--r--)  Uid: ( 1000/linuxteck)   Gid: ( 1000/linuxteck)
Access: 2026-08-10 15:23:45.123456789 +0000
Modify: 2026-08-08 10:12:34.987654321 +0000
Change: 2026-08-08 10:12:34.987654321 +0000
 Birth: 2026-08-01 09:00:00.000000000 +0000
linuxteck@ubuntu:~$

PREVIOUS ARTICLE Quick Linux Tip #49: How do I check if a config file differs between two servers? NEXT ARTICLE Quick Linux Tip #51: How do I know exactly when a file gets created, modified, or deleted?
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.