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
Find accessed file in past 1 or 2 minutes, and throw mail. varungupta UNIX for Advanced & Expert Users 2 09-12-2007 03:07 AM
Find files on minutes basis er_aparna Shell Programming and Scripting 3 07-16-2006 09:57 PM
only find files older than x minutes old dsimpg1 Shell Programming and Scripting 1 05-18-2006 11:48 PM
Convert minutes to hours, minutes, seconds Vozx Shell Programming and Scripting 1 12-09-2005 01:24 AM
find files onder than 15 minutes sveera UNIX for Advanced & Expert Users 11 08-11-2005 03:48 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-18-2008
hari_anj hari_anj is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 6
Find the age of a file in Minutes

KSH:
Please lt me know how to find the age of a file in minutes(Based on last modified time).
ie, if the file was modified 15 Minutes ago, the output should be 15

Last edited by hari_anj; 03-18-2008 at 04:36 AM.. Reason: for specifying the shell name
  #2 (permalink)  
Old 03-18-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
Here is how I would do in ksh:
perl -e 'printf "%d\n" ,(time()-((stat(shift))[9]))/60;' file1.txt

Sorry, but sometimes ksh falls short and you need perl for an assist.
Sponsored Links
Closed Thread

Bookmarks

Tags
perl, perl shift, shift, shift perl

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 05:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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