LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to find the address location of a file? (https://www.linuxquestions.org/questions/linux-software-2/how-to-find-the-address-location-of-a-file-904349/)

vamsi9042 09-22-2011 02:05 AM

How to find the address location of a file?
 
Hi friends,

When we store our files in a Hard Disk(external memory), how do we find the memory location of the file in HD.

Thanks in advance.

Wayne Sallee 09-22-2011 12:15 PM

Are you trying to hack a hard drive, or trying to write code to open a file?

Wayne Sallee
Wayne@WayneSallee.com

Lexus45 09-22-2011 12:21 PM

I'm not sure if I understand you in a right way, but what about using commands:

locate
slocate
find /some/path | grep filename

?

Mr. Alex 09-22-2011 01:06 PM

vamsi9042, do you mean path to file? Or size of the file? Make it more clear please.

anomie 09-22-2011 01:12 PM

Here I was thinking he's looking for the logical block(s) the file lives on.

@vamsi9042: It would help if you gave some examples, too.

Mr. Alex 09-22-2011 01:19 PM

If the question is about searching inodes, then look here.
If you need to look at file size, then use
Code:

du -h /path/to/file
If you need to find a file with some pattern,
Code:

find /path/where/to/search -iname 'pattern'

vamsi9042 09-23-2011 12:12 AM

Quote:

Originally Posted by Mr. Alex (Post 4479436)
If the question is about searching inodes, then look here.
If you need to look at file size, then use
Code:

du -h /path/to/file
If you need to find a file with some pattern,
Code:

find /path/where/to/search -iname 'pattern'

I just want to know, How do they store in HD After pressing ctrl+s.

rknichols 09-23-2011 01:01 PM

Is the output from
Code:

hdparm --fibmap /path/to/some/file
the sort of thing you are looking for?

vamsi9042 09-25-2011 09:19 AM

Thank you....

anomie 09-25-2011 11:36 AM

Quote:

Originally Posted by rknichols
Is the output from
Code:

hdparm --fibmap /path/to/some/file
the sort of thing you are looking for?

Nice one! In spite of OP's slightly confusing communication, I learned a great shortcut in this thread.


All times are GMT -5. The time now is 06:03 PM.