LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-05-2012, 05:42 AM   #1
anandg111
Member
 
Registered: Jan 2012
Posts: 56

Rep: Reputation: Disabled
Smile How to check the last modified time of the file.


How to check the last modified time of the file
 
Old 01-05-2012, 06:14 AM   #2
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Code:
#stat filename
 
Old 01-05-2012, 06:32 AM   #3
anandg111
Member
 
Registered: Jan 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Sorry but I am asking about unix command ant about a function.
 
Old 01-05-2012, 06:45 AM   #4
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
First thing you should know this is a linux blog and you never specified about unix

I am not sure with unix command but I think if you hit a search on google you will get bunch of help

here are some links
http://www.cyberciti.biz/faq/howto-f...files-by-date/
http://www.unixtutorial.org/2008/04/...x-filesystems/

and I believe stat should work in unix as well but best of luck
 
Old 01-05-2012, 06:48 AM   #5
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Suppose you want to find text files that were last modified 60 days ago, use:

Quote:
# find /home/you -iname "*.txt" -mtime -60 -print
 
Old 01-05-2012, 04:55 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
As you can see, when you ask vague questions, you'll generally get vague or useless answers in return.

For better results, you really should provide the following:
  • What you have
    Your distribution, desktop, hardware, configuration, changes you've made recently... anything about your setup that could be relevant.
  • What you want
    Detail exactly what you are trying to accomplish. Be specific. Explain your problem in detail and what you expect from a solution. Start from the beginning.
  • What you did
    What have you tried already? What did you do, in detail? What exact commands have you used? Have you tried searching the web or the archives yet?
  • What you got
    What are the results of the things you tried? What error messages did you get? What other effects or outputs were there?
In short, give us details about everything. Don't assume we will know what you are talking about. We aren't psychic, after all! (Well, most of us, anyway. )

Please read How To Ask Questions The Smart Way, too. The better you frame the question, the more useful the answers will be.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help me write shell script to check the modified date of a file. thinhnguyenduy79 Linux - Newbie 1 06-17-2011 04:14 AM
smbclient check file modified before 'get' hattori.hanzo Linux - Newbie 1 10-28-2010 09:09 AM
[SOLVED] file properties - last access/modified time gmsa Programming 2 04-22-2010 07:27 AM
cat file with its modified date n time coolplanet Programming 7 10-25-2009 08:44 PM
Where can I look for the config file for modified date and time ForumKid Linux - General 1 09-19-2003 08:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration