Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I rm a File with \177 (DEL) in the name?

562 views
Skip to first unread message

ha...@ironwolve.com

unread,
Jul 13, 2005, 1:34:49 PM7/13/05
to
How do I delete this file with a \177 (DEL) in its name with rm? I'm
just curious as I cant seem to get rm to do it with pattern matches.

Yes, I know a couple work arounds, but more curious on how to get "rm"
to delete this file.


Doing an ls -lb
-rw-r--r-- 1 root other 196416 Jul 13 12:20 \177

Anonymous 7843

unread,
Jul 13, 2005, 1:45:02 PM7/13/05
to
In article <1121276089.8...@g49g2000cwa.googlegroups.com>,

1. assuming your shell has globbing on, just

rm -i ?

will present all the one letter files and you can choose
the one that isn't printable.

2. I think all solaris shells accept escape with ^V at the command line

rm ^V^?

where ^V and ^? represent control-V and the delete key
respectively.
--
7842++

Tony Curtis

unread,
Jul 13, 2005, 2:37:27 PM7/13/05
to
>> On 13 Jul 2005 10:34:49 -0700,
>> ha...@ironwolve.com said:

http://www.faqs.org/faqs/unix-faq/faq/part2/section-2.html

has some hairy suggestions...

Bernd Haug

unread,
Jul 14, 2005, 6:36:27 AM7/14/05
to
ha...@ironwolve.com <ha...@ironwolve.com> wrote:
> Yes, I know a couple work arounds, but more curious on how to get "rm"
> to delete this file.
> Doing an ls -lb
> -rw-r--r-- 1 root other 196416 Jul 13 12:20 \177

ls -lbi -> rm `find . -inum <found number>`

lg, Bernd
--
When emailing me, excuse my annoing spamfilter - it works for me.

Sun

unread,
Jul 14, 2005, 9:42:00 AM7/14/05
to

you can use unlink command to delete this file.

The Neflem!

unread,
Jul 19, 2005, 11:19:30 AM7/19/05
to

Why all the fancy "find" and that sort of thing.
Go back to basics...

Just do rm \\177 or rm "\177"

greek_phi...@hotmail.com

unread,
Jul 19, 2005, 1:25:03 PM7/19/05
to
If you want to use minimal
thought effort:

rm -ri . # in the directory the file is in

just hit return until you get to the file

then type y

then hit whatever your interrupt is

Michael Tosch

unread,
Jul 19, 2005, 3:22:29 PM7/19/05
to

Did you really try it?
My Solaris doesnt take it.
But this works the way you describe:

rm -i *

A similar solution:
with Midnight Commander, you can select/delete the file.

--
Michael Tosch @ hp : com

greek_phi...@hotmail.com

unread,
Jul 19, 2005, 4:02:19 PM7/19/05
to
Heh!

No I did not try it!

It did not like the "."

I suppose going up one directory and specifying the
directory name is a way -> "rm -ri directory_with_bad_file ".

Using * may not always work if the escape characters
are funny enough - I think - but then again I am not
going to try it.

.

uni...@gmail.com

unread,
Apr 17, 2014, 12:21:59 PM4/17/14
to
go into bash

ls -b to get the octal number

rm $'\octal character number'
(example rm $'\177\177\177')

Dirk Heinrichs

unread,
Apr 18, 2014, 3:00:29 AM4/18/14
to
uni...@gmail.com wrote:

> On Wednesday, July 13, 2005 12:34:49 PM UTC-5, ha...@ironwolve.com wrote:
>>
>> Yes, I know a couple work arounds, but more curious on how to get "rm"
>> to delete this file.
>>
>> Doing an ls -lb
>> -rw-r--r-- 1 root other 196416 Jul 13 12:20 \177
>
> go into bash

Or into zsh.

> ls -b to get the octal number
>
> rm $'\octal character number'
> (example rm $'\177\177\177')

Type "rm ", then hit TAB twice to get the completion menu and use the cursor
keys to navigate to your file :)

Bye...

Dirk
--
Dirk Heinrichs <dirk.he...@altum.de>
Tel: +49 (0)2471 209385 | Mobil: +49 (0)176 34473913
GPG Public Key CB614542 | Jabber: dirk.he...@altum.de
Sichere Internetkommunikation: http://www.retroshare.org

0 new messages