The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 05:34 AM
Untar a TAR file at different location malaymaru UNIX for Dummies Questions & Answers 5 09-18-2006 08:59 PM
Location of file on disk cysang High Level Programming 3 08-02-2006 08:11 AM
UNIX Start-up file location daveo61 UNIX for Dummies Questions & Answers 3 07-22-2002 08:35 AM
Location of defaultrouter file in Red Hat 98_1LE UNIX for Dummies Questions & Answers 4 12-11-2001 06:23 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-07-2006
Chanakya.m's Avatar
Chanakya.m Chanakya.m is offline
Registered User
  
 

Join Date: Jan 2006
Location: Bangalore, India
Posts: 55
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
  #2 (permalink)  
Old 07-07-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
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.
  #3 (permalink)  
Old 07-07-2006
grumpf grumpf is offline
Registered User
  
 

Join Date: May 2006
Posts: 101
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
  #4 (permalink)  
Old 07-07-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
stat is mostly for Linux boxes - and you're right it does give the information.
  #5 (permalink)  
Old 07-08-2006
ShawnMilo ShawnMilo is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 252
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
  #6 (permalink)  
Old 07-17-2006
Chanakya.m's Avatar
Chanakya.m Chanakya.m is offline
Registered User
  
 

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


Thanks a lot..

Regards,
Chanakya M
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0