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
check timestamp on specific files grinds Shell Programming and Scripting 2 05-16-2008 12:01 PM
to get the timestamp of files from the files and folders in Unix kishan HP-UX 2 04-09-2008 05:20 AM
ftp files -- but keep the original timestamp Perderabo Answers to Frequently Asked Questions 0 07-23-2006 08:43 AM
How do i check if 2 files have same timestamp? pt14 AIX 1 11-18-2005 09:54 AM
comparing timestamp of two files jyotipg Shell Programming and Scripting 2 04-06-2004 03:38 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-07-2008
Registered User
 

Join Date: Apr 2008
Location: bangalore
Posts: 41
how to compare the timestamp of 2 files

i want to compare the timestamp of the 2 file..
please let me know how we can achive this..
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-07-2008
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 758
try searching here
Reply With Quote
  #3 (permalink)  
Old 04-07-2008
aigles's Avatar
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,199
With bash and ksh, use the the following conditional expressions :
Code:
[[ file1 -nt file2 ]]
[[ file1 -ot file2 ]]
Read the man pages for more informations.

Jean-Pierre.
Reply With Quote
Google UNIX.COM
Reply

Tags
bash, ksh

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:31 PM.


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