Results 1 to 4 of 4
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 ...
- 01-16-2009 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 18
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
the grep command returns something like thisCode:ls -ltr | grep 'Jan 16' | xargs ??????
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???Code:-rw-rw-r-- 1 me mygroup 0 Jan 16 09:44 myFile
thanks
-Ray
- 01-16-2009 #2Linux Guru
- Join Date
- Oct 2007
- Location
- Tucson AZ
- Posts
- 1,937
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
- 01-16-2009 #3Just Joined!
- Join Date
- Mar 2008
- Posts
- 18
wow i feel like an idiot....thanks man that worked great!!
- 01-23-2011 #4Just Joined!
- Join Date
- Jan 2011
- Posts
- 1
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 }'
********************************888
ls -ltr | grep 'Jan 16' | xargs ??????



