×
Create a new article
Write your page title here:
We currently have 3,188 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,188Articles

    <man>find</man>

    see also: mansearch, man2html



    Tips[edit]

    If you want to suppress error messages such as[edit]

    find / -name file 
    find: cannot read dir /lost+found: Permission denied
    /dir/file
    

    as these messages are written to errout and not stdout, a nice trick is to pipe errout to null

    find / -name file 2> /dev/null
    /dir/file
    


    EXAMPLE : find /var/log/ -name "20*-*-*_*.log*" -mtime +80 -exec rm {} \;
              deletes all files older than 80 days
    


    Find files files accessed more then +n, less then -n days[edit]

    find . -mtime -100
    find . -mtime +100
    

    Find and delete all files not access for more then 24 hours[edit]

    find . -atime +1 -exec rm '{}' \;
    


    Grep through all files recursively[edit]

    find / -type f -exec grep -li 192.168.1.76 {} \;
    
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.