Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    find files by exact date!!??

    trying to get a command to find files that match a certain date, then run a command on them. i dont want to use find with atime,mtime,ctime because that gives all files greater or less then specified day...not exact.

    so i came up with this command

    ls -ltr | grep 'Jan 16' | xargs ??????
    the grep command returns something like this
    -rw-rw-r-- 1 me mygroup 0 Jan 16 09:44 myFile
    so i need to figure how how to get xargs only to see "myFile" and not the whole line so i can run a command on it. how can I do this???

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Tucson AZ
    I believe if you do not specify a time with a minus (-) or plus (+) but just the number of days ago, for example: 30, it will give the date. Check the info on this site:

    Find files by access, modification date under Linux or UNIX

  3. #3
    wow i feel like an idiot....thanks man that worked great!!

  4. $spacer_open
  5. #4

    can use awk to extract a specific field

    This can work too.
    Little late to help you with your original problem I suppose!

    ls -lR | grep '2007-' | awk '{ print $8 }'


    ls -ltr | grep 'Jan 16' | xargs ??????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts