1827262 Members
2161 Online
109717 Solutions
New Discussion

Re: rm command

 
SOLVED
Go to solution
Jonathan Caplette
Regular Advisor

rm command

Hi guys,

I just wanna know how can I remove a file that I accidently named \ (backslash caracter)???

What happened is I was editing (vi) a file and when I saved it up I accidently touch the "\" instead of the "enter" key...

Anyone know how can I delete that crappy file????

Thanks!!
Jonathan
11 REPLIES 11
Pete Randall
Outstanding Contributor
Solution

Re: rm command

Very carefully do a rm -i *, answering no to every file but the / one. Ctrl C to get out once you've deleted the /.

Pete

Pete
Sachin Patel
Honored Contributor

Re: rm command

#cd source_dir
rm -i *

Say no to all other file except the one you want to remove.

Sachin
Is photography a hobby or another way to spend $
Pete Randall
Outstanding Contributor

Re: rm command

Make very sure you're in the directory you think you're in, too.

Pete

Pete
Sandip Ghosh
Honored Contributor

Re: rm command

Re-direct the ls -la command in a file. Then edit that file to remove the particular file. Then run #sh

Sandip
Good Luck!!!
Craig Rants
Honored Contributor

Re: rm command

Try rm -- "\" the -- option is little know but works great.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
A. Clay Stephenson
Acclaimed Contributor

Re: rm command

Safer answer:

rm -i \\*

or rm \
Use the backslash to quote the backslash.
If it ain't broke, I can fix that.
Frederic Sevestre
Honored Contributor

Re: rm command

Hi,

#rm -i "\\" works fine (the -i just in case...)

Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
S.K. Chan
Honored Contributor

Re: rm command

# rm -i \\*

should be it ..
Helen French
Honored Contributor

Re: rm command

# rm -i //*

OR

# rm -i /* ( -i for selective removal)
Life is a promise, fulfill it!
Jonathan Caplette
Regular Advisor

Re: rm command

Thanks for the fast reply...

the command rm -i * worked fine... I didn't try the others..

Thanks again!!
Jonathan
John Carr_2
Honored Contributor

Re: rm command

hi

rm -i *filename ( without the backslash ) this way will probably only have to say no once.

John.