Results 1 to 5 of 5
hello,
I am trying to use find and remove to get rid of known viruses by name. I am using: # find [path] -iname "file name" --exec rm -vi {} ...
- 01-03-2007 #1Just Joined!
- Join Date
- Nov 2006
- Posts
- 90
find and rm commands
hello,
I am trying to use find and remove to get rid of known viruses by name. I am using: # find [path] -iname "file name" --exec rm -vi {} \;, and this works perfect, BUT, how do i ask for more than one file name? like # find [path] -iname "file one" "file 2" --exec rm -vi {} \; i am not sure how to do the syntax right. this one does not work
- 01-03-2007 #2
You can write the name of all the files that you want to delete or (better) you can write a regular expression to match all that files.
Best Regards
- 01-04-2007 #3Just Joined!
- Join Date
- Nov 2006
- Posts
- 90
thanks for the help but i tried that and i cant get the syntax down. could you write an example out to go by? thank you
- 01-04-2007 #4
Make a file called testfile containing the names of the virii, each on their own line. I did this in a small little test directory to make sure it worked for you. I couldn't get rm interactively, and --exec gave me predicate errors... Anywho, after this command you will have all the files in a quarantine directory anyways. Once they're there, you can do whatever you want. Sorry if it's kinda dirty lol
Code:cat test/testfile.txt | xargs -i[replace] find ./test -iname [replace] | xargs -i[replace] mv [replace] ./test/quarantine
- 01-05-2007 #5Just Joined!
- Join Date
- Nov 2006
- Posts
- 90
thanks for all the help!


Reply With Quote