![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple Files Renaming with space | nazri76 | UNIX for Dummies Questions & Answers | 13 | 10-04-2008 09:04 AM |
| How to delete multiple space or tabs from a read only file | bisla.yogender | Shell Programming and Scripting | 6 | 05-14-2008 04:38 AM |
| Space problem in files | vibhor_agarwali | UNIX for Dummies Questions & Answers | 6 | 05-21-2007 11:43 PM |
| Script to delete all data from multiple files | uni_ajay_r | Shell Programming and Scripting | 5 | 03-29-2006 08:05 AM |
| Need a script to delete multiple files | navycow | UNIX for Dummies Questions & Answers | 3 | 01-16-2006 11:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
when I try to run rm on multiple files I have problem to delete files with space
Hello
when I try to run rm on multiple files I have problem to delete files with space. I have this command : find . –name "*.cmd" | xargs \rm –f it doing the work fine but when it comes across files with spaces like : "my foo file.cmd" it refuse to delete it why? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
In this case when rm encounters a filename such as "my foo file.cmd", the space seperated words in the file will be treated as different files. So rm will try to remove files named "my", "foo", and "file.cmd", which it will not find.
A workaround for this will be: Code:
find . -name "*.cmd" -exec rm {} \;
|
||||
| Google The UNIX and Linux Forums |