Mailinglist Archive: opensuse (3135 mails)

< Previous Next >
Re: [opensuse] remove files
  • From: Vince Oliver <vince@xxxxxxxxxxxxxxx>
  • Date: Wed, 7 Mar 2007 12:29:04 +0100 (CET)
  • Message-id: <Pine.LNX.4.62.0703071226570.24904@xxxxxxxxxxxxxx>
thanks for reply. trick works :)

May I ask you for one more trick? How to remove ALL files from directories EXCEPT '*.pro'?


Many thanks Sylvester




On Wed, 7 Mar 2007, Sylvester Lykkehus wrote:

Vince Oliver wrote:

Hi All,


How to easily remove some particular files from more than one directory. For example I have directories:

$ ls -l
total 12
drwx------+ 2 ovince None     0 Mar  6 16:36 DHbox1
drwx------+ 2 ovince None     0 Mar  7 08:30 DHbox10
drwx------+ 2 ovince None     0 Mar  6 16:36 DHbox2
drwx------+ 2 ovince None     0 Mar  6 16:36 DHbox3
drwx------+ 2 ovince None     0 Mar  6 16:36 DHbox4
drwx------+ 2 ovince None     0 Mar  7 08:31 DHbox5
drwx------+ 2 ovince None     0 Mar  6 16:37 DHbox6
drwx------+ 2 ovince None     0 Mar  6 16:37 DHbox7
drwx------+ 2 ovince None     0 Mar  6 16:37 DHbox8
drwx------+ 2 ovince None     0 Mar  6 16:37 DHbox9

from all these directories I would like to remove JUST files that finish wit suffix = 'pro' and suffix = '.dat' keeping others untouched

thanks
oliver
Hi Oliver,
find DHbox* -name *.dat | xargs rm
should do the trick.

Best regards
Sylvester
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups