Computing.Net > Forums > Unix > file modified time in seconds

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

file modified time in seconds

Reply to Message Icon

Name: alexandria
Date: July 3, 2002 at 07:01:54 Pacific
Comment:

Hi,
Is there a way to find the last modified time of a file using a unix command.I will need to execute a remote execution so do not think I will be able to use the perl code posted.
-Thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: frank
Date: July 3, 2002 at 07:49:18 Pacific
Reply:

simple UNIX command would be ls -l
part of the output is the modification time.

You can change it to
ls -l | awk ' {print $6,$7,$8,$9} '

but this is a kind of scripting.

No RISK no Fun
Frank



0

Response Number 2
Name: alexandria
Date: July 3, 2002 at 08:50:02 Pacific
Reply:

Thanks is there a way to get it in plain seconds not in the formatted form???


0

Response Number 3
Name: frank
Date: July 3, 2002 at 10:04:42 Pacific
Reply:

alexandria,

in seconds of what ?
Based on the 1.1.1970 ?
Seconds since the file was modified till now ?

Without a script ? or only without perl ?

No RISK no fun

Frank


0

Response Number 4
Name: Alexandria
Date: July 3, 2002 at 10:57:46 Pacific
Reply:

Yes based on 1.1.1970.
Something that can be executed within a rexec command.


0

Response Number 5
Name: Frank
Date: July 3, 2002 at 11:24:53 Pacific
Reply:

There is no simple unix command to do so on the OS I know.

You can wirte a shell script or use the utime subroutine.

anyway all solutions are rexec compatible.

Try to find an alternative.
Why do you need time in seconds since 1.1.1970.

No RISK no fun

Frank



0

Related Posts

See More



Response Number 6
Name: Alexandria
Date: July 3, 2002 at 12:41:55 Pacific
Reply:

Need to work along with some PHP code and it does not have a file modified time that works on my server .


0

Sponsored Link
Ads by Google
Reply to Message Icon

Crontab Problems !!!! user interface



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: file modified time in seconds

Can someone help wid KSH script err www.computing.net/answers/unix/can-someone-help-wid-ksh-script-err/8021.html

retreive the date with the time --URGENT www.computing.net/answers/unix/retreive-the-date-with-the-time-urgent/2933.html

Time in Unix www.computing.net/answers/unix/time-in-unix/2488.html