{ 29 comments… read them below or add one }

1 Anonymous 01.31.06 at 12:41 pm

What I’m wondering is:”how to do that on a remote server via ftp?” :)

2 nixcraft 01.31.06 at 9:18 pm

Very easy :) Login to your remote ftp server.

ftp http://ftp.some.com

Goto directory where special character files placed. And type command:

mdel *

mdel will ask you if you really wish to delete each file in the directory. Make sure you answer y (for yes) for each file containing the special character that you wish to delete. Hope this helps.

3 Anonymous 02.02.06 at 3:34 pm

how about deleting the file using
rm ./”filename”

as in this case $ rm “+Xy +8″
./+Xy +8: ? (y/n) y
$

4 Anonymous 02.02.06 at 3:43 pm

adding to my previous post there is an instance when your rm “filename” wont work.
say u created a file –help
it wont get deleted by using rm “–help”

so we have to rm ./”–help”

5 Anonymous 04.07.06 at 5:54 pm

Anonymous: your tip won’t work if the filename has very weird characters (non-printable characters, that is)

6 calib0rx 09.12.06 at 10:32 am

“Anonymous: your tip won’t work if the filename has very weird characters (non-printable characters, that is)”

Um, yes it will, did you actually try it? Eg, go in to vi and save a file with :wq [ctrl-v backspace]q[ctrl-v backspace]

which would look like “^?q^?” and continue. Now you have:

-rw-r–r– 1 root wheel 0B Sep 12 00:55 ?q?

Where’s the ^!!!!

So now with ls -li:

516 -rw-r–r– 1 root wheel 0 Sep 12 00:55 ?q?

and:

[root@host ~]# find . -inum 516 -exec rm -i {} ;
remove ./q? y
[root@host ~]#

file is gone.

7 Anonymous 10.03.06 at 8:43 pm

To make sure find only finds the files in the correct directory use the -mount switch to prevent it jumping across mount points.

8 Liam 12.22.06 at 2:04 am

This is a simple process:
root@liam # mkdir ^Hms^?
root@liam # ls -l
total 14
drwxr-xr-x 2 root other 512 Dec 22 12:59ms

list the directory using octal representation. So you know the control characters in the name.

root@liam # ls -lb
total 14
drwxr-xr-x 2 root other 512 Dec 22 12:59 10ms\177

Now simply rm “Control V”"Backspace”ms”Control V”"Delete”

Where Control V is a key combination and Backspace is a key. As is Delete. In the above example 10 is BS (BackSpace) and \177 is Delete.

Very simple…

9 William 09.13.07 at 10:51 pm

I have a directory structure:

# ls -ila
total 20
2179132 drwxrwsr-x 2 www www 16384 2007-09-14 00:16 .
2081399 drwxrwsr-x 101 www www 4096 2007-06-27 14:32 ..
? ?——— ? ? ? ? ? 1a6b29c00be.jar

the last entry couldn’t remove (fsck.ext3 /dev/sd12, rm -f, rm -rf to parent dir, stb…), because no inode. I no idea how to remove it, only found format the partition :(

10 FiNeX 10.26.07 at 11:40 am

William, I’ve your problem too:

ls -lia
total 40
14663798 drwxr-xr-x 2 1001 1001 36864 2007-10-26 13:27 .
14663789 drwxr-xr-x 3 1001 1001 4096 2007-10-26 13:27 ..
? ?——— ? ? ? ? ? PROVA D’ABILIT? FF8.htm
? ?——— ? ? ? ? ? Prova d’abilit? ff9.htm

I can’t format the partition! There is more than 100Gb of backup file in it!!!!

someone have some further suggestions?

11 rubberband 12.20.07 at 6:45 pm

I was able to remove a weird file name with unlink in Linux.
I just inputted:
unlink ‘weird file !@#$%&.txt’

12 Markus 04.03.08 at 5:26 am

other way to remove files: try e2fsprogs
it is working on hardly not removing files with wrong attributes

debugfs
open -w /dev/…
rm File
close
q

be carefull!

13 bd 05.08.08 at 3:14 pm

Desi Style. Move all others which you can delete to a different folder.
Then rm -rf * & restore all those back

14 Balakumar 06.26.08 at 6:44 am

It is very useful command to delete files which contain special Characters..

15 franklin 08.04.08 at 10:11 am

what is rootkit

16 Les 08.27.08 at 1:20 am

Thanks, that worked very well!

17 newel 09.19.08 at 9:57 am

how about if removing a directory with special character with a file within it?

18 MindGrill 12.19.08 at 10:58 am

Hi,

I am trying to delete a file with inode number in hp ux but it is not prompting anything neither it is deleting teh file?
what can be the problem??

Thanks
MindGrill
http://mindgrillq.blogspot.com

19 lotr 01.20.09 at 8:52 am

So now the other way around, I want to put back in the directory structure file that is still used by some process (inode is hnown from the /proc//fd).

20 Zimx 02.18.09 at 7:13 am

Hi All,

permission all files are: -rwxrw-rw-

I have 23982 total of files, I am triying to remove all of it but I alwasy got this error: “Permission denied”

what I have tried:
tried to change the permission on single file
chmod 777 filename
chmod: WARNING: can’t access 777
chmod: ERROR: invalid mode
(not working)

chown to my id (not working)

rm using inode (same error: Permission denied)

rm using wildcard (not working)

mv some files or single file to other directory (not working: Persmissin denied)

please help me to remove this junk files…

thanks,
Zimx

21 Y Rodrigues 03.06.09 at 8:45 pm

I have a file called winhelp.exe16. I can not delete it, neither by your method!
I am from Brazil, “Operação não permitida” means “Operation not allowed”.

[yr@localhost dlls]$ ls -l winhelp*
—–w—- 1 root 32784 98320 Jan 4 1970 winhelp.exe16
[yr@localhost dlls]$ stat winhelp*
File: `winhelp.exe16′
Size: 98320 Blocks: 16 IO Block: 4096 arquivo comum
Device: 308h/776d Inode: 289 Links: 1
Access: (0020/—–w—-) Uid: ( 0/ root) Gid: (32784/ UNKNOWN)
Access: 1970-01-02 18:30:56.000000000 -0300
Modify: 1970-01-04 06:55:28.000000000 -0300
Change: 1970-01-03 12:43:12.000000000 -0300
[yr@localhost dlls]$ find . -inum 289 -exec rm -i {} \;
rm: remove write-protected arquivo comum `./winhelp.exe16′? y
rm: imposível remover `./winhelp.exe16′: Operação não permitida
[yr@localhost dlls]$ su
Password:
[root@localhost dlls]# find . -inum 289 -exec rm -i {} \;
rm: remove write-protected arquivo comum `./winhelp.exe16′? y
rm: imposível remover `./winhelp.exe16′: Operação não permitida
[root@localhost dlls]#

22 Y Rodrigues 03.06.09 at 10:09 pm

Hi, people,

I got a way to delete this file. I ‘ve used debugfs. It has a rm command like the shell. Easy boys, read the man page.

23 ciccio 04.02.09 at 6:24 pm

normal people use rm — \\+Xy\ \\+\\8 , and that’s it :)

24 ciccio 04.02.09 at 6:25 pm

that long line is a double middle dash :\ rm “double dash” etc..

25 thiru 07.07.09 at 7:22 am

Hi friend,

Can any one teach me or tell me how to do backup using tape drive. currently i using “tar cMvf /dev/st0 /home” but not very sure on this. how to do complete backup for few directory using 1 command.

Thanks

thiru

26 farnaz 07.12.09 at 2:57 pm

How can I delete a picture in Linux?

27 Dave K 09.03.09 at 4:41 pm

Guys, for most cases you can just cd into another dir and do rm ../”-rf-file” and it works a charm. Only prob I had which brought me here was a file name “^M”
don’t ask how I got it but i could not delete it to save my life…

28 netors 09.21.09 at 2:53 pm

I have a server with a web app,
my inodes are all used up,
i see this tutorial to delete inodes,
but, i do not know which inodes/files to delete
i dont know where my web app is creating this innodes… how can i know this?’

29 2GB 09.30.09 at 2:42 pm

got a 2gb+ file which refuses to delete because of file system does not like large files. sco openserver unix.

my question is: can i delete it using the inode thing. i don’t want to risk it by trying it before i know the concequences!.

Thanks for yor help

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: