Displaying the Last Modification Time of a specific file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Displaying the Last Modification Time of a specific file
# 1  
Old 08-02-2008
Bug Displaying the Last Modification Time of a specific file

How can I get and display the last modification time of a file? in scripting or specifically using Batch file

I want this info for me to determine whether an image has been edited or not by using the last modification time and compare it to our stored date of modification.

can somebody help me with this problem? I really need this urgently. thanks
# 2  
Old 08-02-2008
Hammer & Screwdriver Perhaps the stat command will help?

See the following:

Code:
> stat guess_game
  File: `guess_game'
  Size: 292             Blocks: 16         IO Block: 8192   regular file
Device: 3f8c350h/66634576d      Inode: 239534      Links: 1
Access: (0770/-rwxrwx---)  Uid: ( 1249/ xxxxxxx)   Gid: (  402/      dp)
Access: 2008-07-02 23:21:03.712322000 -0700
Modify: 2008-02-18 13:54:53.839126000 -0800
Change: 2008-02-18 13:54:53.839126000 -0800

# 3  
Old 08-02-2008
Code:
find "file" -printf "%t"

# 4  
Old 08-03-2008
is it recognize in batch files? (.bat)
# 5  
Old 08-03-2008
which shell are you using? what does this tell you?
Code:
echo $SHELL

# 6  
Old 08-03-2008
Quote:
Originally Posted by jaque18
is it recognize in batch files? (.bat)
batch files are just commands combined to perform stuffs for you. If you installed GNU find, you can use it in your batch file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with text modification and displaying

I have a file storing some text and another file storing some numbers I want to display characters other than the specified place of strings one.txt xyz abc 233 skfo 4r443 sfs abc abcd sd fsdf sdfd abc 11 abc 33 abc dsaf two.txt Nt_djd_k='5-6,7-9' Nt_hh_l='3-6,7-8' a=`grep... (4 Replies)
Discussion started by: rahulsk
4 Replies

2. Programming

File date/time modification and permissions

First, oh great Unix gurus, forgive if this is a stupid question. Unix/Linux is not my main thing but I have been programming in C/C++ for many years. I will do my best to be specific. I have a program in C/C++ that needs to modify the time of a given file. Currently I do this using utime()... (5 Replies)
Discussion started by: Pug
5 Replies

3. Shell Programming and Scripting

How to change modification time of file?

Explain it with proper e.g (4 Replies)
Discussion started by: sidpatil
4 Replies

4. Shell Programming and Scripting

Notification of the modification of a specific entry in a file

I need to get notification via email when the line containing a pattern is changed in a file. Not during the time any changes to file occurs. Ie if we reset a user password say example, demouser the hash in the line containing the word demouser in the file /etc/group changes. So when this change... (1 Reply)
Discussion started by: anil510
1 Replies

5. UNIX for Dummies Questions & Answers

Need Modification Time of a file

Hi all, I need the modification time of a file on a particular day say 3 days before. I just don't want the last modification time. I need all the modification times on a particualar day. Is there anyway to do it? Kindly help. Could anyone tell me where the modification time is stored?... (1 Reply)
Discussion started by: vidhyab
1 Replies

6. Shell Programming and Scripting

File modification time comparison

Hi All, I have two files (given below) each exists under different paths. I want to compare the modification time stamp of file1.txt is lessthan the modification time of file2.txt. month1=`ls -l file1.txt | awk '{ print $6}'` date1=`ls -file1.txt | awk '{ print $7}'` time1=`ls... (1 Reply)
Discussion started by: Arunprasad
1 Replies

7. UNIX for Dummies Questions & Answers

Displaying specific columns in a file

Hi, I'm just wondering how you display a specific set of columns of a specified file in Unix. For example, if you had an AddressBook file that stores the Names, Phone numbers, and Addresses of people the user entered in the following format (the numbers are just to give an idea of what column... (1 Reply)
Discussion started by: logorob
1 Replies

8. Shell Programming and Scripting

ls -e to find out File modification time in secs

Hi All, I would like to know the file modification time till seconds in Unix. So I tried ls -e and it worked fine. This Solaris 5.10 -rw-rw-r-- 1 test admin 22 Sep 12 11:01:37 2008 test_message But I am not able to run the same command in SOlaris 5.6 and also in AIX/HP Is there... (3 Replies)
Discussion started by: rahulkav
3 Replies

9. UNIX for Dummies Questions & Answers

Displaying specific lines in a file.

I'm trying to figure out how to display a certain line in a text file. I keep getting references to Tail and Head, and I know how these work, but i'm lost on how to find say the third out of the five lines and display only that. I thought maybe grep could help, but that doesn't seem likely. ... (3 Replies)
Discussion started by: MaestroRage
3 Replies

10. UNIX for Dummies Questions & Answers

File modification time

Does anyone know how to display the time with seconds of when a file was last modified. I can get hour & minutes but would also like seconds. --Running AIX (1 Reply)
Discussion started by: edog
1 Replies
Login or Register to Ask a Question