The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
escaping special characters in file name... lau0001 Shell Programming and Scripting 1 01-19-2008 05:54 PM
Removing special characters in file srivsn Shell Programming and Scripting 6 01-03-2008 03:10 AM
Replace Special characters in a file solai UNIX for Dummies Questions & Answers 1 07-13-2006 07:36 AM
how to see special characters in a file using vi jingi1234 UNIX for Dummies Questions & Answers 6 10-19-2005 08:57 AM
search special characters in a file cramya80 UNIX for Dummies Questions & Answers 2 05-13-2005 09:08 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-12-2006
Registered User
 

Join Date: Apr 2006
Posts: 2
How to delete a file with special characters

I don't now exactly how I did it, but I created a file named " -C "

cexdi:/home1 $ls -lt
total 1801336
-rw------- 1 cexdi ced-group 922275840 23 mars 10:03 -C

How do I delete this file ?

cexdi:/home1 $rm -C
rm: invalid option -- C
Syntax : rm [-Rfir] filename ...

Doesn't work... I'm stuck.
Reply With Quote
Forum Sponsor
  #2  
Old 04-12-2006
Registered User
 

Join Date: Apr 2006
Posts: 2
Found it.

bash-3.00# mkdir tata
bash-3.00# cd tata
bash-3.00# rm ../"-C"
Reply With Quote
  #3  
Old 04-12-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
many ways of doing it,

1) give the full path and delete
2) find the inode no and delete through that
3) rm \-C
Reply With Quote
  #4  
Old 04-12-2006
Registered User
 

Join Date: Mar 2006
Location: Nashville
Posts: 77
Long way.

Do a rm -i. This will prompt you 1 file at a time.

Works good if dirs are small or your scared of what might happen.

-X
Reply With Quote
  #5  
Old 08-14-2007
Registered User
 

Join Date: Aug 2007
Posts: 1
two very ways to do this:

1.) rm -- -r
2.) rm ./-r

Beauty lies in Simplicity!!!!!!
Reply With Quote
  #6  
Old 08-22-2007
psiva_arul's Avatar
Registered User
 

Join Date: Jul 2007
Location: Bangalore, India
Posts: 78
You can delete filename with full path

let me see

rm <filename_path> <filename>

or
rm <filename_path> *-C

Regards,
Siva.P
Bangalore
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0