Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rm

Status
Not open for further replies.

fluid11

IS-IT--Management
Jan 22, 2002
1,627
US
I have a directory with a bunch of files. Lets say all the files are named file.001, file.002, file.003, and so on. Is it possible to do an " rm -f file* " but specify to not delete one of the files?

rm -f file* "but not file.005"

Thanks in advance,
CP
 
Nevermind. I figured it out.

rm -f file.??[0-4,6-9]
 
or even better...

rm -f file.??[!5]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top