find command help
Posted: 2018/03/01 14:35:06
Hi Everyone!
I need some help with the find command. I'd like to querry pdf files with date and file size in a specific range of date. I have to sum the file size what I get the end of the process.
find / -newermt "2018-01-20" \! -newermt "2018-03-01" -type f -iname '*.pdf' -print0 | xargs -0 du -h >> txt.txt
The first case I get the size and the filename.
find / -type f -iname '*.pdf' -printf "\n%AD %AT %p" -newermt "2018-01-20" \! -newermt "2018-03-01" >> txt.txt
In here I get the date and the filename. I'm beginner in CentOS, so I'd like to ask some help or advice. Thank you!
I need some help with the find command. I'd like to querry pdf files with date and file size in a specific range of date. I have to sum the file size what I get the end of the process.
find / -newermt "2018-01-20" \! -newermt "2018-03-01" -type f -iname '*.pdf' -print0 | xargs -0 du -h >> txt.txt
The first case I get the size and the filename.
find / -type f -iname '*.pdf' -printf "\n%AD %AT %p" -newermt "2018-01-20" \! -newermt "2018-03-01" >> txt.txt
In here I get the date and the filename. I'm beginner in CentOS, so I'd like to ask some help or advice. Thank you!