What is the file location?

Hi Dudes,
How can we get the details of file system on which a perticular file is located? Is there any way to get the file system (DISK) of a perticular file directly or indirectly?

Thanks in advance

Reg,
Chanakya

df /path/to/file
# or 
cd /path/to/file
df .

will show a lot of other stuff, but it includes what you want, I believe.

the 'stat' command gives you a lot of information of a file also its location but a bit crypted.

stat /tmp/xx.msg
File: `/tmp/xx.msg'
Size: 4401 Blocks: 16 IO Block: 4096 regular file
Device: 805h/2053d Inode: 30 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ walter) Gid: ( 100/ users)
Access: 2006-06-16 13:51:05.000000000 +0200
Modify: 2005-11-11 18:58:51.000000000 +0100
Change: 2005-11-11 18:58:51.000000000 +0100

stat is mostly for Linux boxes - and you're right it does give the information.

Well, if it's a command within your $PATH, you can use 'which.'

which bash #Will tell you the path of bash. Try it on ls, find, etc.

Otherwise, use find to locate the file.

Then, you can use /etc/mtab or /etc/fstab to determine the filesystem in use on that partition.

If that doesn't answer your question, please state what you're looking for in a little more detail.

Shawn

Hi All,
The answers given by you solved my issue. Sorry for delayed response.

Thanks a lot..

Regards,
Chanakya M