- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cant delete non-existent directory in hpux
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 10:08 AM
тАО04-09-2010 10:08 AM
cant delete non-existent directory in hpux
# ls -b gives me
\177\177\177\177\177
for a file directory name.
deleting via inode gets me
ulasap1#find . -xdev -inum 16433 -exec ll {} \;
total 0
ulasap1#find . -xdev -inum 16433 -exec rm -i {} \;
r directory
how do i delete this bogus directory?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 10:15 AM
тАО04-09-2010 10:15 AM
Re: cant delete non-existent directory in hpux
You can't use a simple 'rm to delete a directory. You need to either (very carefully) specify 'rm -r' or use 'rmdir'.
That said, you should remember that an inode number is only unique to a file system. Thus, when using 'find()' it is advisable to restrict the search to the path in question with '-xdev'. In all, if the object that you are trying to delete is truly an empty directory, do:
# find /path -xdev -type d -exec rmdir {} +
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 10:24 AM
тАО04-09-2010 10:24 AM
Re: cant delete non-existent directory in hpux
see the output from ls -lb
drwxrwxr-x 2 dm1adm sapsys 7168 Apr 9 11:56 sapnames
-rwxr-x--- 1 root sys 20764 Mar 29 15:11 saproot.sh
drwxr-xr-x 3 eq1adm sapsys 96 Oct 22 2007 servicehttp
drwxrwxr-x 2 dm1adm sapsys 17408 Apr 9 12:22 tmp
drwxrwxrwx 3 dm1adm sapsys 96 Aug 13 2007 upgrade
-rw-rw---- 1 1076 sapsys 166877 Mar 29 09:16 zc00637i.dat
drwxr-x--- 2 dm1adm sapsys 96 Mar 29 15:19 \177\177\177\177\177
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 10:26 AM
тАО04-09-2010 10:26 AM
Re: cant delete non-existent directory in hpux
If not, you can simply:
cd DELDELDELDELDEL # (5 DEL keys)
Then remove any files and then "cd -" and rmdir that directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 10:29 AM
тАО04-09-2010 10:29 AM
Re: cant delete non-existent directory in hpux
It doesn't matter where the directory resides in the tree of the filesystem as long as you know the inode number and as long as you don't cross into another filesystem. I meant to write:
# find /path -xdev -type d -inum 16433 -exec rmdir {} +
You could substitute the current directory for '/path' and you could omit the '-type d' to give:
# find . -xdev -inum 16433 -exec rmdir {} +
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 10:32 AM
тАО04-09-2010 10:32 AM
Re: cant delete non-existent directory in hpux
"." is fine, unless you are in /.
>see the output from ls -lb
Adding -i would be helpful.
>JRF: when using find(1) it is advisable to restrict the search to the path in question with '-xdev'.
Andy already had that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 10:41 AM
тАО04-09-2010 10:41 AM
Re: cant delete non-existent directory in hpux
was the successful route.
thanks very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2010 11:05 AM
тАО04-09-2010 11:05 AM
Re: cant delete non-existent directory in hpux
> thanks very much.
You're most welcome. I see that you are new to the ITRC Forums, so "welcome!". If the answers you received were helpful, please read:
http://forums11.itrc.hp.com/service/forums/helptips.do?#28
Regards!
...JRF...