Operating System - HP-UX
1753396 Members
7237 Online
108792 Solutions
New Discussion юеВ

Re: Problems removing file with special characters

 
SOLVED
Go to solution
dictum9
Super Advisor

Problems removing file with special characters


Any idea how to remove this? It doesn't show up with "ls -l"

/etc/rc.config.d#: ls -lab | tail -1
-rw------- 1 root sys 8371 Jun 4 15:38 \177\177\177
6 REPLIES 6
Michal Kapalka (mikap)
Honored Contributor
Solution

Re: Problems removing file with special characters

hi,

on this link a very good howto.

its a combination of ls and find.

http://www.cyberciti.biz/tips/delete-remove-files-with-inode-number.html

mikap
Patrick Wallek
Honored Contributor

Re: Problems removing file with special characters

I would:

1) Do an 'ls -labi' and make a note of the inode number

2) find . -inum -exec ls -labi {} \;
to make sure it is the correct file. If it is, then

3) find . -inum -exec rm {} \;

James R. Ferguson
Acclaimed Contributor

Re: Problems removing file with special characters

Hi:

Among the easy ways to remove a file like this is to use its inode number:

# ls -ilab

...lists in octal notation any non-printable characters as you have seen but with the inode number of the file in the leftmost column.

Once you have that, do:

# find . -xdev -type f -inum -exec rm -i {} +

Substitute the correct inode number for .

NOTE CAREFULLY: Inode numbers are only unique within a filesystem.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Problems removing file with special characters

Why do you think this file has special chars? :-)
If you have stty erase as ^h, you can just use the DEL char as a ordinary char.
Lijeesh N G_1
Respected Contributor

Re: Problems removing file with special characters

Hi,

You can delete this kind of file with inode number;

>>Find out the inode number of this file with,
#ls -il

>>Remove the file with,
#find . -inum -exec rm -i {} \;


Regards,
LIJEESH N G
dictum9
Super Advisor

Re: Problems removing file with special characters

Thank you, it worked.