I want to get all files after a specific date. I tried with:
ls -ltr | awk {'print $6'} | sed s/-//g | awk {'if ($1-20110415 > 0 ) {print $1}'}
which works 50% fine. The last command prints only date of file. How to print date of file and filename? In the awk $8
is the filename, but I don't know how to transfer till last print
in the command line.
Thank you, Luke
ls command ls – Listing contents of directory, this utility can list the files and directories and can even list all the status information about them including: date and time of modification or access, permissions, size, owner, group etc.
Try find command like this:
find /my/path -mtime -1 # to get files modified in last 1 day
find /my/path -mtime -1.5 # to get files modified in last 1.5 day
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With