Operating System - HP-UX
1822040 Members
3549 Online
109640 Solutions
New Discussion юеВ

Re: rm non-existent error

 
SOLVED
Go to solution
Ben_219
Advisor

rm non-existent error

I am trying to remove a file and receive non-existent message. See attachment for more detail. This file was left from a hang ftp session that was already terminated. HP-UX 11.00 has since been rebooted.

Any help is greatly appreciated.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: rm non-existent error

Hi Ben:

No doubt the file has unprintable characters in its name and you are not seeing what you think you are seesing.

There are several ways to handle this:

# ls -lb ftp*

...will show the filename with unprintable characters in octal \ddd notation.

# rm -i ftp*

...will allow you to respond "y" to the file(s) you want to remove.

# find . -type f -name "ftp*" -exec ls -ilb {} \;

...will show the file(s) inode number in the first column and expose the unprintable characters in the name.

Then, having found the inode number, you can remove the file thusly:

# find . -xdev -type f -inum -exec rm {} \;

...substitute the correct inode number for and *be sure* to include '-xdev' to that you don't cross mountpoints. Inode numbers are only unique within a filesystem!

Regards!

...JRF...
Ben_219
Advisor

Re: rm non-existent error

Thanks James. ls -lb ftp* did show the file name with \ in it.

Ben_219
Advisor

Re: rm non-existent error

James' answer solved my problem.