The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
file attributes and exception krem UNIX Desktop for Dummies Questions & Answers 1 09-03-2006 05:45 PM
Assigning file attributes to variables olimiles Shell Programming and Scripting 5 08-18-2006 06:31 AM
file attributes Hitori Shell Programming and Scripting 1 07-12-2006 12:12 PM
file attributes hytechpro Shell Programming and Scripting 2 09-16-2005 06:32 AM
rcp and file attributes jhansrod Shell Programming and Scripting 2 05-26-2005 08:28 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 09-13-2001
Registered User
 

Join Date: Sep 2001
Location: London, UK
Posts: 2
Need to view all the attributes for a file/node

I need to find out when a file has been created. 'ls -l' just lists the last date the file was modified, not the creation date. I have also noticed when viewing the attributes through NT, the last modified date is the same as the file creation date. I thought maybe this was a fault due to Samba.

Kind regards,

Darren Palmer
Forum Sponsor
  #2  
Old 10-02-2001
Registered User
 

Join Date: Oct 2001
Location: San Francisco
Posts: 27
Assuming you have perl on your system you can use the "stat" command from within PERL, something like:

perl -e '($devno,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks)=stat($ARGV[0]);print "$ARGV[0] $atime $ctime $mtime\n";' /some/file/name

- dEvNuL
  #3  
Old 10-02-2001
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
First, UNIX inodes do not store file creation
date/time information. Use the stat(1) command
to get inode information.

The "stat" command will display...

$ stat hello
File: "hello"
Size: 11751 Filetype: Regular File
Mode: (0775/-rwxrwxr-x) Uid: ( 501/bbarrett) Gid: ( 501/bbarrett)
Device: 3,65 Inode: 800032 Links: 1
Access: Sun Sep 16 11:31:06 2001(00016.11:37:42)
Modify: Sun Sep 16 11:30:51 2001(00016.11:37:57)
Change: Sun Sep 16 11:30:51 2001(00016.11:37:57)

...that's all you get on UNIX
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




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


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

Content Relevant URLs by vBSEO 3.2.0