Operating System - Linux
1752785 Members
5906 Online
108789 Solutions
New Discussion юеВ

Re: Deleting an archive with an space

 
SOLVED
Go to solution
Arturo Galbiati
Esteemed Contributor

Re: Deleting an archive with an space

Hi,
try rm -i *command*txt and confirm when asked.
probably rm log* doesn't run because the separator is not a speca but a non printable chars.
HTH,
Art
Stephen Keane
Honored Contributor

Re: Deleting an archive with an space

If my recommendation didn't work, then you don;t have spaces between the words making up the file name.

try the following to see non-printtable characters ...

# ll | cat -v

you can match each non-printable character with a '?'
Manuales
Super Advisor

Re: Deleting an archive with an space

Hi ..!!!
i can't delete the file !!!

the name of the file is: "-sh proceso.log"

how can i do it??

please help !!!

Thanks !!!
Tom Danzig
Honored Contributor

Re: Deleting an archive with an space

rm -- "-sh proceso.log"
Jeff_Traigle
Honored Contributor

Re: Deleting an archive with an space

Or by per the example in the rm man page:

rm "./-sh proceso.log"
--
Jeff Traigle
James R. Ferguson
Acclaimed Contributor

Re: Deleting an archive with an space

Hi Manuales:

Once again, the method I posted is generally applicable to files with *any* special characters. This includes files beginning with "-".

You can also do:

# touch /tmp/-
# cd /tmp
# rm -- -

The "--" syntax says that there are no more switches to a command and what follows is an argument; in this case a filename.

By the way, in my earlies posts, above, I dropped the hyphen form 'xdev'. The 'find' should read:

# find . -xdev -name "bad*" -exec ls -li {} \

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: Deleting an archive with an space

Hi Manuales:

Once again, the method I posted is generally applicable to files with *any* special characters. This includes files beginning with "-".

You can also do:

# touch /tmp/-
# cd /tmp
# rm -- -

The "--" syntax says that there are no more switches to a command and what follows is an argument; in this case a filename.

By the way, in my earlies posts, above, I dropped the hyphen form 'name'. The 'find' should read:

# find . -xdev -name "bad*" -exec ls -li {} \

Regards!

...JRF...
Manuales
Super Advisor

Re: Deleting an archive with an space

Thanks all friends !!!

it was worked with:
rm -- "-sh proceso.log"

Thanks !!!
Manuales.
Manuales
Super Advisor

Re: Deleting an archive with an space

Hi Sanjay, thanks for link
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=953425

and Geoff Wild, thanks for link http://www.sas.upenn.edu/computing/help/Unix/special_char.html

Thanks, is very interesting this site !!!

:0D
Manuales.