rajeshkumar created the topic: Find Linux Command Collection
Find files modified in the last 48 hours, and in current folder and one level below
I believe the correct command is `find -maxdepth 2 -type f -mtime -2
• maxdepth: will tell find to only search in the current folder
• type: will tell find to only list files and not directories
• mtime: will tell find to only list the files modified in the last 24 hours
To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories:
find /directory_path -mtime -1 –print
To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories:
find /directory_path -type f -mtime -1 –print
find . -type f -mtime -1 –print
To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:
touch -t `date +%m%d0000` /tmp/$$
find /tmefndr/oravl01 -type f -newer /tmp/$$
rm /tmp/$$
The first command can be modified to specify other date and time, so that the commands will return all files that have changed since that particular date and time.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND