- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Directory removal on HP-UX
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
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
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
11-20-2011 06:59 PM
11-20-2011 06:59 PM
Directory removal on HP-UX Systems
Hi,
I need some more clarification on directory removal.
1) If a file system is mounted on mount point /opt/red/blue.
what will happen If i issue $rm -rf /opt/red/blue/*
2) If a file system is mounted on mount point /opt/red/blue/ and there are couple of directories created underneath it
Like /opt/red/blue/dir1/dir2.
(i) If i issue rm -rf /opt/red/blue/dir1/*
(ii) If i issue rm -rf /opt/red/*
I don't have access to HP-UX test server and don't want to try any destructive commands on live production servers.
Thanks,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2011 01:28 AM
11-21-2011 01:28 AM
Re: Directory removal on HP-UX Systems
1.)
All the files and sub-directories (and their sub-directories...) in /opt/red/blue will be deleted.
Exception: if there are hidden files/directories (=files/directories with "." as the first character of their filenames) in /opt/red/blue, they will not be deleted. Hidden files/directories in non-hidden sub-directories of /opt/red/blue will all be deleted. This is because the * wildcard will match only non-hidden files and directories, but the "-r" option will cause everything in matched files and directories to be deleted.
2.)
i) All the files and sub-directories in /opt/red/blue/dir1 will be deleted, including /opt/red/blue/dir1/dir2 and everything inside it. (with a similar exception as in case 1)
ii) All the files and and sub-directories in /opt/red will be deleted, except /opt/red/blue because it cannot be deleted before unmounting the filesystem (and you will get an error message about not being able to delete the mount point). However, the contents of /opt/red/blue will all be deleted: the /opt/red/blue filesystem will become empty. (The same exception as in case 1 applies in /opt/red directory.)
This is basic POSIX filesystem and shell command behavior, not really anything specific to HP-UX. You would get the same results on Linux, or on any other Unix-style OS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2011 01:30 AM
11-21-2011 01:30 AM
Re: Directory removal on HP-UX
>1) If a file system is mounted on mount point /opt/red/blue.
>what will happen If I issue rm -rf /opt/red/blue/*
If you have the right permissions, you'll remove all files and directories under blue/.
>(I) If I issue rm -rf /opt/red/blue/dir1/*
You will remove all files and directories under dir1/.
>(ii) If I issue rm -rf /opt/red/*
You will remove all files and directories under red/.
>I don't have access to HP-UX test server and don't want to try any destructive commands
Other than NFS, you can create and remove your own directory trees.