Home » Infrastructure » Unix » How to find last modified date of a file
How to find last modified date of a file [message #160424] Sat, 25 February 2006 08:27 Go to next message
mrpranab
Messages: 32
Registered: March 2005
Member
Hi Everyone,

Can you tell me which command I will use to see the last modified date of a file.

I am using crontab for auto mailing purpose to the end-user.How can I know the last run time of the particular shell script file. Which command I will use for it?

Thanks & Regards
Pranab
Re: How to find last modified date of a file [message #160433 is a reply to message #160424] Sat, 25 February 2006 12:42 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Can you tell me which command I will use to see the last modified date of a file.

A script is NOT modified when it runs.
The question above is totally different than the one below.

>How can I know the last run time of the particular shell script file.

>Which command I will use for it?
If you really need this information, I suggest you modify the
script such that is does something like

$ date > /tmp/last_run_time.lis

then the contents of this file contains your answer.
Re: How to find last modified date of a file [message #160439 is a reply to message #160433] Sun, 26 February 2006 00:31 Go to previous messageGo to next message
mrpranab
Messages: 32
Registered: March 2005
Member
Hi,

Actually I have two different queries.These are:

Q.1.Can you tell me which command I will use to see the last modified date of a file.

Q.2.I am using crontab for auto mailing purpose to the end-user.How can I know the last run time of the particular shell script file. Which command I will use for it?


Thanks
Pranab
Re: How to find last modified date of a file [message #161188 is a reply to message #160439] Thu, 02 March 2006 08:28 Go to previous message
kshkid
Messages: 24
Registered: November 2005
Junior Member
mrpranab wrote on Sun, 26 February 2006 00:31

Hi,

Actually I have two different queries.These are:

Q.1.Can you tell me which command I will use to see the last modified date of a file.

Q.2.I am using crontab for auto mailing purpose to the end-user.How can I know the last run time of the particular shell script file. Which command I will use for it?


Thanks
Pranab




For last modified time; upon modification itself current time would be stamped to inode entry of the particular file, you cannot just retrieve the last modified time you would be having only one modified time and that one would be available in inode and retrieve it as ls -lrt

for the time when script is last run ls -lut

u - usage time
Previous Topic: (database connection) unresolved sqlcxt
Next Topic: FTP Script with verification
Goto Forum:
  


Current Time: Thu Apr 18 17:37:32 CDT 2024