"Badly placed ()'s." error while trying to do selective rm -rf
Hi,
My directory consists of different files and folders. I want to delete all but 2 files. I'm invoking the following command. rm -rf !(file1|file2) where file1 and file2 are the files I want to keep. Upon executing the above command I see this error : Badly placed ()'s. Shell information : csh Where am I wrong? Thanks, Technizia |
You are asking for trouble, as linux does have a friendly undelete facility. Try something like
Code:
cp file1 file2 /tmp |
Quote:
|
@business_kid I want to remove the other files without doing the copy and move back.
@ntubski Is there a similar approach that can be used in csh? |
Code:
|
Quote:
|
All times are GMT -5. The time now is 08:36 AM. |