Documente Academic
Documente Profesional
Documente Cultură
com
http://w w w .thegeekscope.com/find-files-in-linux-using-findcommand/
Example: Search for files in the /root folder which contains the string monitor in the filename # find /root -type f -name "*monitor*" /root/monitor_script.sh /root/monitor_script.sh.v2 /root/monitor_script.sh.v1 Example: Search for folders in the /root folder which contains the string monitor in the foldername # find /root -type d -name "*monitor*" /root/test/test_monitor123 Example: Search for files/folders in the /root folder which contains the string monitor in the name # find /root -name "*monitor*" /root/test/test_monitor123 /root/monitor_script.sh /root/monitor_script.sh.v2 /root/monitor_script.sh.v1
www.thegeekscope.com
Example: Search /etc folder for files/folders modified in last 7 days # find /etc -mtime -7 You can use atime in place of mtime to find files and folders based on last access time in days. Example: Search /etc folder for files/folders accessed in last 7 days # find /etc -atime -7
<x> along with + sign indicates, modified before x mins <x> along with - sign indicates, modified within last x mins <x> with no sign indicates, modified exactly x mins ago Example: Search /home folder for files/folders modified exactly 60 minutes ago # find /home -mmin 60 Example: Search /home folder for files/folders modified before 60 minutes # find /home -mmin +60 Example: Search /home folder for files/folders modified in last 60 minutes # find /home -mmin -60 You can use amin in place of mmin to find files and folders based on last access time in mins. Example: Search /etc folder for files/folders accessed in last 60 mins # find /etc -amin -60
www.thegeekscope.com
# find /etc -size 20015c Example: Search /root folder for files/folders having size greater than 2 megabytes # find /etc -size +2M Example: Search /home folder for files/folders having size less than 1 kilobytes # find /etc -size -1k
Example: Find all files/folders owned by user kam # find / -user kam
Example: Search /home folder for files/folders accessed in last 2 hours or having size greater than 10MB # find /etc -amin -120 -or -size +10M Tagged as: Find Command, Find Files, Find files in LInux, Find files in Unix, Linux Find Command, Search Files, Using Find Command
www.thegeekscope.com