1832857 Members
3231 Online
110047 Solutions
New Discussion

Re: file cant be removed

 
David Bellamy
Respected Contributor

file cant be removed

hi

i have a file "MAT04" in my "mat04" file system. omniback completes with errors on this file. i tried to remove it but it says 'not found'. when i do an ls it comes back as '/MAT04', but when i do an ll it comes back as './MAT04 not found'. it doesnt seem to have an inode and i cant get rid of it. any ideas? thanks in advance.
7 REPLIES 7
Andreas Voss
Honored Contributor

Re: file cant be removed

Hi,

sound like the filename has unprintable characters.
To remove do:
rm -i *MAT04*
Answer with 'y' if you are sure it is the correct file.

Regards
James R. Ferguson
Acclaimed Contributor

Re: file cant be removed

David:

Most likely there are non-graphic characters in the filename. Try:

# rm -i MAT04*

Use the interactive (-i) option for safety.

...JRF...



Kofi ARTHIABAH
Honored Contributor

Re: file cant be removed

how about this:

find . -name "*MAT04*" -exec rm -f {} \;

or you could use the -i option for rm if you want to see what gets removed.
nothing wrong with me that a few lines of code cannot fix!
John Palmer
Honored Contributor

Re: file cant be removed

Hi David,

As the others have said the filename includes non-printable characters (which could be in the middle of the name) - delete characters are favourites.

In order to find out what you have, it may be necessary to pipe the output of ll into the 'od' command - see man od for details.

Regards,
John

Eileen Millen
Trusted Contributor

Re: file cant be removed

You can also get rid of it or rename it from
within the File Manager in CDE or HP/VUE.
Rita C Workman
Honored Contributor

Re: file cant be removed

Whenever I have files with bogus characters I usually try this:

ls -i *

Then I simply do the following to find it from where I am and remove it:

find . -inum xxxx -exec rm {} \;

Regards,
Rick Garland
Honored Contributor

Re: file cant be removed

To see the unprintable characters in a filename, 'ls -lq'

If you have copy and paste ability, you can highlight the filename, paste it to the rm command.