The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to put file from one ftp to another ftp location prasee Shell Programming and Scripting 1 03-28-2008 01:34 AM
Untar a TAR file at different location malaymaru UNIX for Dummies Questions & Answers 5 09-18-2006 05:59 PM
Location of file on disk cysang High Level Programming 3 08-02-2006 05:11 AM
UNIX Start-up file location daveo61 UNIX for Dummies Questions & Answers 3 07-22-2002 05:35 AM
Location of defaultrouter file in Red Hat 98_1LE UNIX for Dummies Questions & Answers 4 12-11-2001 02:23 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-07-2006
Chanakya.m's Avatar
Registered User
 

Join Date: Jan 2006
Location: Bangalore, India
Posts: 55
Stumble this Post!
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-07-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,837
Stumble this Post!
Code:
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.
Reply With Quote
  #3 (permalink)  
Old 07-07-2006
Registered User
 

Join Date: May 2006
Posts: 95
Stumble this Post!
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
Reply With Quote
  #4 (permalink)  
Old 07-07-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,837
Stumble this Post!
stat is mostly for Linux boxes - and you're right it does give the information.
Reply With Quote
  #5 (permalink)  
Old 07-08-2006
Registered User
 

Join Date: Jun 2006
Posts: 159
Stumble this Post!
Quote:
Originally Posted by Chanakya.m
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
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
Reply With Quote
  #6 (permalink)  
Old 07-16-2006
Chanakya.m's Avatar
Registered User
 

Join Date: Jan 2006
Location: Bangalore, India
Posts: 55
Stumble this Post!
Hi All,
The answers given by you solved my issue. Sorry for delayed response.


Thanks a lot..

Regards,
Chanakya M
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0