1820531 Members
2170 Online
109626 Solutions
New Discussion юеВ

Cannot delete directory!

 
SOLVED
Go to solution
Robert Finley
New Member

Cannot delete directory!

I have a directory (named application) on a B.11.11 U 9000/800 system that I cannot do anything with.

drwx------ 5 root sys 96 Sep 9 14:55 application

I cannot get into the directory -
# cd application
sh: application: not found.

I cannot creat a subdirectory -
# mkdir /application/test
dir: cannot access /application: No such file or directory

and rm -Rf does not remove it and returns no errors. How can I get rid of this directory?

7 REPLIES 7
Sundar_7
Honored Contributor
Solution

Re: Cannot delete directory!

May be there are some control characters in the directory name

# echo * | cat -v

Look for any control characters displayed

# rm -rf *application*

this should work

Learn What to do ,How to do and more importantly When to do ?
Sridhar Bhaskarla
Honored Contributor

Re: Cannot delete directory!

Hi,

Looks like there are some special characters attached to the name. I usually try to use wild characters if possible to get rid of them. Try various combinations and see if any of them work. For ex.,

#ll -d applica*
#ll -d *plicat*

Make sure which combination works and then move it to another directory

#mkdir junk
#mv *plicat* junk
#cd junk
#ll

(make sure it is only the directory that is appearing) then remove the directory

#cd ..
# rm -rf junk

You can simply remove it in one step with just the wildcards, all the above steps are to ensure that you do not accidentally delete anything.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Robert Finley
New Member

Re: Cannot delete directory!

Bingo!
Great job. Thanks.
Sundar_7
Honored Contributor

Re: Cannot delete directory!

What was the problem Robert ? :-)
Learn What to do ,How to do and more importantly When to do ?
steven Burgess_2
Honored Contributor

Re: Cannot delete directory!

Hello

Another quick way to do this would be

ll -i (note the inode number)

find . -inum -exec rm {} \;

Steve
take your time and think things through
Sundar_7
Honored Contributor

Re: Cannot delete directory!

But if you have some other filesystem mounted under your current directory, then it is likely that more than one file will match the INUM and thus you might end up deleting files otherwise you dont want to delete.
Learn What to do ,How to do and more importantly When to do ?
steven Burgess_2
Honored Contributor

Re: Cannot delete directory!

use the -xdev option then

take your time and think things through