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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to get the timestamp of files from the files and folders in Unix kishan HP-UX 2 04-09-2008 09:20 AM
how to compare the timestamp of 2 files mail2sant Shell Programming and Scripting 2 04-07-2008 05:43 AM
ftp files -- but keep the original timestamp Perderabo Answers to Frequently Asked Questions 0 07-23-2006 12:43 PM
How do i check if 2 files have same timestamp? pt14 AIX 1 11-18-2005 01:54 PM
comparing timestamp of two files jyotipg Shell Programming and Scripting 2 04-06-2004 07:38 AM

Reply
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 4 Weeks Ago
ssuresh1999 ssuresh1999 is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 51
Timestamp of old files

Hi
I have a question if i give ls -ltr i get in the following order
I dont get time stamp of old files where as the latest ones have time stamp
How can i get the timestamp in the old files of 2008 and the one file of Jan 2009

-rw-rw-r-- 1 console staff 204 Nov 19 2008 msg
-rw-rw-r-- 1 console staff 296 Nov 24 2008 adj
-rwx--x--x 1 console staff 11557920 Dec 9 2008 file
-rw-rw-r-- 1 console staff 202 Jan 28 2009 test.msg
-rw-r--r-- 1 console staff 11557920 Jan 29 2009 test1
-rwx--x--x 1 console staff 130952 Sep 23 4:32 ram
-rwx--x--x 1 console staff 1299800 Sep 23 4:32 sum
-rwx--x--x 1 console staff 639504 Sep 23 4:32 system


Thanks in advance
  #2 (permalink)  
Old 4 Weeks Ago
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 748
Depends on what version of Unix we are talking about?

Try stat(1):

Code:
stat filename

e.g.:

Code:
$ stat fstab
  File: `fstab'
  Size: 480           Blocks: 8          IO Block: 4096   regular file
Device: 805h/2053d    Inode: 3931634     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2009-11-04 13:53:25.000000000 +0000
Modify: 2008-12-13 22:52:49.000000000 +0000
Change: 2008-12-13 22:52:49.000000000 +0000
$

  #3 (permalink)  
Old 4 Weeks Ago
binlib binlib is offline
Registered User
  
 

Join Date: Aug 2009
Location: New Jersey
Posts: 72
ls on Linux has the --full-time option.
  #4 (permalink)  
Old 4 Weeks Ago
ssuresh1999 ssuresh1999 is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 51
Thanks for your answers stat in my unix is not giving the desired result , it is working just like cat

On the other hand
ls --full-time is working well in linux giving the desired result
Reply

Bookmarks

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 07:46 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