Saturday, October 11

mtime



what is the command for,
1. find logs of last 5 days
2. find logs of last 5th day
3. find logs of last 10 to 20 days.
4. find logs of particular day(15aug2014).
5. find logs of particular period (15th aug to 20th aug)



  • 1. find logs of last 5 days find . -name xxxxx.log -mtime -5
  • 2. find logs of last 5th day find . -name xxxxx.log -mtime 5
  • 3. find logs of last 10 to 20 days find . -name xxxxx.log -mtime +10 -mtime -20 
  • 4. find logs of particular day(15aug2014). find . -type f -mtime $(( ( $(date +%s) - $(date -d '2014-08-15' +%s) ) / 60 / 60 / 24 - 1 ))
  • 5. find logs of particular period (15th aug to 20th aug) find . -type f -mtime +$(( ( $(date +%s) - $(date -d '2014-08-15' +%s) ) / 60 / 60 / 24 - 1 )) -mtime -$(( ( $(date +%s) - $(date -d '2014-08-15' +%s) ) / 60 / 60 / 24 - 1 ))

1 comment:

  1. If you need your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (no matter why you broke up) you must watch this video
    right away...

    (VIDEO) Win your ex back with TEXT messages?

    ReplyDelete