LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 06-27-2005, 12:13 AM   #1
Prasun1
Member
 
Registered: Jun 2005
Posts: 41

Rep: Reputation: 15
Question metadata information


Hi all,

This is yet another problem that has been bugging me for quite some time.What I intend to do is to find out if at all there is any way by which we can find out the metadata information in the unix filesystem ?

I am trying to simplify the problem. In unix fileystsem say I have an ordinary file called file1 .Now I can always view the contents of this file by doing a cat , head , view etc but all that mean that I can view the contents of the file. What if I really want to find out the metadata information pertaining to this file ? Noteworthy to mention , here I am really not trying to find out the inode number of the file , since that can be easily done by
ls - i -l.I am trying to find the loction where if I look I can get the approximate size that is utilised to store the metadata information for this file ?

It will be so nice if anyone can throw light in this matter.

Thanks Prasun.
 
Old 06-27-2005, 12:49 AM   #2
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
Just about all of the metadata about a file can be read with the 'stat' command.

Some files also have extended attributes, for those you need to use attr, getfattr and setfattr.

Some files can have ACLs in addition to normal unix rights, for those you need getfacl and setfacl.
 
Old 06-27-2005, 01:11 AM   #3
Prasun1
Member
 
Registered: Jun 2005
Posts: 41

Original Poster
Rep: Reputation: 15
Exclamation metadata information

Thanks a lot .


But still I would like to know one thing !

How shall I use this command ...is it like this stat <filename> ? I had tried out with every other option that you have suggested like stat , attr , etc but none of them seem to work in my machine.

Plaese tell me how shall I use the command to know the metadata information for a particular file.

Thanks Prasun
 
Old 06-27-2005, 05:49 PM   #4
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
/usr/bin/stat is part of coreutils on my machine, I can't imagine that you wouldn't have it too.

/usr/bin/attr is part of the attr package.

/usr/bin/getfacl is part of the acl package.

Both of those are optional since they're not in very widespread use so far, but I would imagine that most distributions have them packaged somewhere.
 
Old 06-27-2005, 11:06 PM   #5
Prasun1
Member
 
Registered: Jun 2005
Posts: 41

Original Poster
Rep: Reputation: 15
Question metadata information

Hi,

Thanks a lot for your reply.I went to my /usr/bin and /bin directory to find dbiostat , lpstat ,

netstat , nfsstat but not stat. But anyways I will try to 'man' them and find out what needs to

be done.Meanwhile it will be great if you can tell me as to how shall I find out the space

allocated for the metadata information of a file.


Thanks and Regards
Prasun.
 
Old 06-27-2005, 11:11 PM   #6
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
Re: metadata information

Quote:
Originally posted by Prasun1
Meanwhile it will be great if you can tell me as to how shall I find out the space
allocated for the metadata information of a file.
That would be very filesystem specific.
 
Old 06-27-2005, 11:25 PM   #7
Prasun1
Member
 
Registered: Jun 2005
Posts: 41

Original Poster
Rep: Reputation: 15
Yes, I want to find out exactly that . I mean how much ( in terms of space unit slike KB , MB etc)

metadata information is stored for a particular file.


Thanks Prasun.
 
Old 06-27-2005, 11:32 PM   #8
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
I know what you mean, but it would be very filesystem specific and would require special tools like xfs_db or xfs_admin for XFS filesystems.

Why do you need to know this?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I access metadata from the command line? WilliamMcMath Linux - General 1 11-03-2005 01:04 PM
SuSE 9.3, KDE 3.4..metadata suddenly not showing in tooltips. RoaCh Of DisCor Suse/Novell 3 07-26-2005 05:42 PM
Konqueror - Hover over an icon to view metadata RoaCh Of DisCor Linux - Software 12 07-25-2005 10:54 AM
torrent metadata (files) modifier abs Linux - General 0 04-17-2005 01:35 AM
IPTC metadata in photos dotancohen Linux - Software 0 02-04-2005 09:18 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration