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
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024