Menü +

find ./ -type f -name '*source-string*'

find- search for files in a directory hierarchy

[[email protected]] find / -name "httpd.conf"      # -name
[[email protected]] find / -iname "httpd.conf"     # -iname
                     # Ignoring Case, in the current directory and 
                     # all its sub directories.
-maxdepth
[[email protected]] find -maxdept 2 -name "httpd.conf"
-mindepth
[[email protected]] find -mindepth 3 -name "httpd.conf"
[[email protected]] find -mindepth 3 -maxdepth 5 -name "httpd.conf" 
---------------------------------------------------
------------------
-user
[[email protected]] find / -user vivek
-group
[[email protected]] find / -group vivek
---------------------------------------------------
------------------
-mtime
[[email protected]] find / -mtime 50
Modifid time, (50 napja )
[[email protected]] find / -mtime +50 -mtime -100
Több mint 50 kevesebb mint 100 napja lett 
módosítva
 50 = ötven, 
-50 = kevesebb mint ötven, 
+50 = több mint ötven
-atime
[[email protected]] find / -atime 50 
Access heure jogosultsag
-ctime
[[email protected]] find / -ctima 50 
Change heure
-amin
[[email protected]] find / -amin -cmin
[[email protected]] find / -cmin -60 -mmin
[[email protected]] find / -mmin -60
# --- | -size
[[email protected]] find / -size 50M
[[email protected]] find / -size +50M -100M
[[email protected]] find / -size +100M -exec rm  -rf {} \;
# --- -type 
# ---       d // directory 
# ---       f // regular file
# ---       l // symbolic link
[[email protected]] find / -type d

---------------------------------------------------
# ------------------
# -prem
[[email protected]] find / -prem 0777
[[email protected]] find / ! -prem 777

# --------------------------------------------------
[[email protected]] find / -prem 1644
# --- Sticky Bit
#
[[email protected]] find / -prem 2644 
# --- SUID - SetUserID
#
[[email protected]] find / -prem 4644
# --- SGID - SetGroupID
#
# --------------------------------------------------
[[email protected]] find / -type f -prem 0777 -print chmod 644 {} \;
[[email protected]] find / -type d -prem 777 -print chmod 755 {} \;
[[email protected]] find . -type f -name "valami.txt" -exec rm -f {} \;
[[email protected]] find . -type f -name "*.txt" -exec rm -f {} \;
# ---------------------------------------------------------
# ---    :
#
find . -type f -newermt "2010-01-01" ! -newermt "2010-06-01"
# ---------------------------------------------------------

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.