User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » linux: deleting file with special character Page [1]  
DirtyMonkey
All American
4269 Posts
user info
edit post

i've got a huge list of files to delete, some of which are named with special characters such as ')'. an example would be:

t_43466).jpg


i *could* delete using the inode, but i'm hoping there is an easier solution like escaping the character or something like that. any suggestions?

3/25/2008 12:48:22 PM

darkone
(\/) (;,,,;) (\/)
11610 Posts
user info
edit post

does this not work:

rm -fr *)*

3/25/2008 12:55:16 PM

DirtyMonkey
All American
4269 Posts
user info
edit post

sorry, i should have been more clear. i have about 100,000 files to delete, but i'm not deleting them based off the filename. i build a list of rm commands for each file that is flagged to be deleted, and some of them have a ) or other character in them. this is the error i get:


bash: rm -v ./6/6/t_43466).jpg;
bash: syntax error near unexpected token `)'

3/25/2008 12:58:29 PM

GraniteBalls
Aging fast
12262 Posts
user info
edit post

http://ubuntuforums.org/showthread.php?t=122103

[Edited on March 25, 2008 at 1:17 PM. Reason : use backslash or single quote]

3/25/2008 1:16:20 PM

DirtyMonkey
All American
4269 Posts
user info
edit post

single quote worked great. thanks.

i should have googled the error message, dur.

3/25/2008 1:29:15 PM

GraniteBalls
Aging fast
12262 Posts
user info
edit post

3/25/2008 1:29:57 PM

 Message Boards » Tech Talk » linux: deleting file with special character Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.