Remove files and directories
Recursively Search All Files For A String:
find . -name "FILE-TO-FIND" -exec rm -rf {} \;Remove only files
find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;Find files older then 10 days
find /var/log -mtime +10Find files older then 30 min
find /tmp -mmin +30Remove files older then X days
find /path/* -mtime +5 -exec rm {} \;Find and move files
find ~/projects/* -mtime +14 -exec mv {} ~/old_projects/ \;
Recursively Search All Files For A String:
cd /path/to/dir
find . -type f -exec grep -l "word" {} +
find . -type f -exec grep -l "seting" {} +
find . -type f -exec grep -l "foo" {} +
Нема коментара:
Постави коментар
Напомена: Само члан овог блога може да постави коментар.