mardi 2 décembre 2014

linux + find command with rm -rf


why the following command removed the tmp directory under /var and how to avoid this?



find /var/tmp -type d -ctime -1 -exec rm -rf {} \;


pwd
/var/tmp
[root@linux /var/tmp]# find /var/tmp -type d -ctime -1 -exec rm -rf {} \;
find: /var/tmp: No such file or directory


Aucun commentaire:

Enregistrer un commentaire