LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-06-2007, 06:21 AM   #1
Mikka
LQ Newbie
 
Registered: Mar 2007
Posts: 2

Rep: Reputation: 0
inode filenames


Hello!

Is there a smart way of getting all the filenames from inode number with multiple links? I know I can do find over entire disk to check for the inode number, but is there a faster way of doing it?

Thanks and take care, M.
 
Old 03-06-2007, 09:35 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
The inode of a file only stores the number of links to it, not the actual locations of the links.
This is only stored in the blocks that describe directories: the content of a directory is, simply said, not much more than a list of inodes and names of all files and subdirectories.
This is the only link between a filename and it's inode that is actually stored on disk.

Hence, you'll need to scan all directories' contents (by reading the blocks used to store directories) and filter out the entries that have a certain inode number...which is exactly what "find -inum" does for you!
It should be quite fast unless you have thousands of small directories.

So, I guess the answer to your question is probably "no".
 
Old 03-06-2007, 10:01 AM   #3
Mikka
LQ Newbie
 
Registered: Mar 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply, timmeke, just wanted to be sure.
 
Old 03-06-2007, 10:02 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
You're welcome, Mikka.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
inode ahmed gamal Slackware 2 04-02-2006 08:34 AM
inode muthiahm Linux - Newbie 2 06-11-2004 04:00 PM
about inode eshwar_ind Programming 3 04-24-2004 02:39 PM
increasing inode value LVRV Linux - General 1 11-25-2003 03:57 PM
why did this inode change? jlangelier Linux - Security 1 08-10-2003 09:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration