středa 5. listopadu 2008

Find a exec cmd

chmod -R 655 /dir aplikuje práva i na adresáře, což je nežádoucí. Je možno použít find a jím vykonávat chmod.

find /tmp/ -name "*.txt" -exec chmod 400 "{}" \;

find /tmp/ -type d -exec chmod 755 "{}" \;

find /tmp/ -type c -exec chmod 664 "{}" \;

find /tmp/ -type d | xargs -n 1 chmod 775

Dale poznamka jak mazat pomoci find?

find dir/ -name CVS -exec rm -rf "{}" \;

Žádné komentáře: