linux find

Download Linux Find

If you can't read please download the document

Upload: redro

Post on 01-Feb-2016

4 views

Category:

Documents


0 download

DESCRIPTION

Linux usefull commands

TRANSCRIPT

find . -type f -atime -700 -exec ls -l {} \;find . -type f -mtime +60 -exec ls -l {} \;find . -type f -mtime +30 -exec rm -rf {} \;find . -name "*" -ctime +365 -exec du -sh {} \;find . -type f -mtime +10 -print | xargs -I {} mv {} /home3/backups/eyeflyInboxCamelfind . -type f -mtime +20 -print | xargs -I {} mv {} /home3/backups/DHL_PROD_INBOXfind . -size 0c -exec rm {} \; -- all 0 size filesfind . -maxdepth 1 -size 0c -exec rm {} \; -- including sub-directoriesLage (20mb) filesfind / -type f -size +20000k -exec ls -lh {} \; for current directoryfind . -type f -size +20000k -exec ls -lh {} \; * -mtime +60 means you are looking for a file modified 60 days ago. * -mtime -60 means less than 60 days. * -mtime 60 If you skip + or - it means exactly 60 days.[a] access (read the file's contents) - atime[b] change the status (modify the file or its attributes) - ctime[c] modify (change the file's contents) - mtimeYou can search for files whose time stamps are within a certain age range, or compare them to other time stamps. find linux versioncat /etc/redhat-release