Find

Iš Žinynas.
Jump to navigation Jump to search
find . -type f -mtime +15 # rasti faila senesni negu 15 dienu
find . -type f -mtime +15 -exec rm -f {} + # rasti ir istrinti senesnius negu 15 dienu failus
find . -mtime +0 # find files modified greater than 24 hours ago
find . -mtime 0 # find files modified between now and 1 day ago
# (i.e., in the past 24 hours only)
find . -mtime -1 # find files modified less than 1 day ago (SAME AS -mtime 0)
find . -mtime 1 # find files modified between 24 and 48 hours ago
find . -mtime +1 # find files modified more than 48 hours ago

The following may only work on GNU?

find . -mmin +5 -mmin -10 # find files modified between
# 6 and 9 minutes ago
find / -mmin -10 # modified less than 10 minutes ago

Rasti visus failus iskyrus .rar ir .zip ir juos istrinti:

find . -type f \( ! -iname \*.rar ! -iname \*.zip \) -exec rm {} \;

Rasti visus rar failus ir juos ispakuoti, skirtas sis scriptas