Quantcast
Channel: Remove directory, except when pointed to by symbolic link - Unix & Linux Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by X Tian for Remove directory, except when pointed to by symbolic link

GNU find has an option -samefile, you need to include -L option for this to work.Take a look at the output of the following two commands(cd /dir1 ; find -L . -samefile ln/app ) # your file and link(cd...

View Article



Answer by Kusalananda for Remove directory, except when pointed to by...

Assuming you want to delete all the subdirectories of the app directory apart from v001 (which does not contain log.xml) and v004 (which is being pointed to by the symbolic link):for topdir in /dir1...

View Article

Remove directory, except when pointed to by symbolic link

I have the below directory structure. I need to find the directories in which a file called log.xml exists and remove all of them completely, except the directory which is pointed to by a specific...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images