- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem after rm -rf *
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
Forums
Discussions
Discussions
Discussions
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
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
05-07-2008 01:55 AM
05-07-2008 01:55 AM
just out of curiosity,on one of my test server i fired #rm -rf * to see which files will be deleted, now i am unable to telnet and run any command...
but to my surprise its running only pwd and cd command but not /usr/bin/pwd and /sbin/ls..
can anybody throw some light on reason for this
and is there any way to recover the system..
thankx in advance..
Solved! Go to Solution.
- Tags:
- rm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 02:58 AM
05-07-2008 02:58 AM
Re: problem after rm -rf *
These commands are in memory, you can not use the /usr/bin/pwd etc because they are not there anymore.
You will have to recover from a make_tape(net)_recovery or reinstall from cd.
Best regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 03:16 AM
05-07-2008 03:16 AM
Re: problem after rm -rf *
You will have to restore from your ignite backup. Some commands are inbuilt in the shell, that is why you are able to run them.
good luck!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 03:21 AM
05-07-2008 03:21 AM
Re: problem after rm -rf *
You did this in /?
Isn't it obvious what will happen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 04:40 AM
05-07-2008 04:40 AM
Re: problem after rm -rf *
You will now need to rebuild (cold-install) your server.
The fact that 'cd' and 'pwd' continue to run may be due to the presence of these commands as shell built-ins in addtion to being standalone executables.
As for recovering your server, I trust that you have a good Ignite backup image. You will certainly need to rebuild from scratch, otherwise!
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 09:56 AM
05-07-2008 09:56 AM
Re: problem after rm -rf *
#rm -rf *
to see which files will be deleted"
Now you know it ... if you would ask instead, it would be not that painful ...
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 10:10 AM
05-07-2008 10:10 AM
Re: problem after rm -rf *
"i was fired after #rm -rf *"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 10:19 AM
05-07-2008 10:19 AM
Re: problem after rm -rf *
http://docs.hp.com/en/B2355-60103/rm.1.html
Your command forced to delete everything below your current directory.
But now you have a very solid status and plenty of space on the disks ...
;-)
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 10:58 AM
05-07-2008 10:58 AM
Re: problem after rm -rf *
on Linux systems) of giving "root" a home
directory other than "/", like "/root". It
doesn't actually educate (or raise the IQ of)
the fellow who has the "root" password, but
it can help to limit the damage in a case
like this. (Some of the time, at least.)
> [...] to see which files will be deleted
> [...]
Which files did you think that it _wouldn't_
delete?
> and is there any way to recover the
> system..
And the best time to think about this is
when?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 11:04 AM
05-07-2008 11:04 AM
Re: problem after rm -rf *
when?
I guess the answer is: NOW.
__LOL__
You just found 1 out of many ways to destroy the system, but there are sooo many other ways ... if you want to test some others, let us know ...
Keep smiling.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 12:22 PM
05-07-2008 12:22 PM
SolutionThe "chmod -R 777 *" club
The "chown -R root:bin *" Club
As mentioned, the "/" directory is the *WORST* possible location for root's HOME yet unfortunately, this is the default for virtually all flavors of UNIX. Never cd to / unless you are shutting down. Never execute any command that can recursively act on files and directories until you have previewed the command (ie, rm -i *) and now that you know the consequences, put these aliases in /etc/profile:
alias rm="/usr/bin/rm -i"
alias cp="/usr/bin/cp -i"
alias mv="/usr/bin/mv -i"
This will help immensely by prompting you with something like this:
rm -i -rf *
/stand/vmunix: ? [y/n]
AS you might expect, it would be a bad thing to remove /stand/vmunix...etc.
Another really useful command is: type
This is actually an alias to "whence -v" and is the only useful way to determine what will be run when you type a command. In your case:
# type pwd cd ls
pwd is a shell builtin.
cd is a shell builtin.
ls is /usr/bin/ls
The commands: which and whereis are useless in telling you what will happen in the shell. For instance, in my shell, I get this:
pwd is an alias for /usr/bin/pwd
cd is a shell builtin.
ls is an alias for /usr/bin/ls -aF
In other words, I am *NOT* running the 'normal' commands because I have aliased pwd and ls. The reason for pwd is to show the 'real' directory when using cd in the shell to follow a transition link. For example:
$ cd /usr/spool/lp/interface
$ type pwd
pwd is a shell builtin.
$ pwd
/usr/spool/lp/interface
$ /usr/bin/pwd
/etc/lp/interface
The shell can be a bit misleading at times...
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 08:01 PM
05-07-2008 08:01 PM
Re: problem after rm -rf *
Bill i was just wondering to know what is
The "chmod -R 777 *" club
The "chown -R root:bin *" Club are all about ?
can you throw some light on these ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 08:21 PM
05-07-2008 08:21 PM
Re: problem after rm -rf *
>The "chmod -R 777 *" club
>The "chown -R root:bin *" Club are all about ?
these were just anecdots that Bill has used just to say that there have been people before you who have had the same incident before. So, you are not the privileged member of this club... :)
Nothing to worry about. It was just a joke!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 08:34 PM
05-07-2008 08:34 PM
Re: problem after rm -rf *
>The "chmod -R 777 *" club
>The "chown -R root:bin *" Club are all about ?
Please don't try this!, else, you may have to post one more query :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 08:35 PM
05-07-2008 08:35 PM
Re: problem after rm -rf *
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2008 08:58 PM
05-07-2008 08:58 PM
Re: problem after rm -rf *
No need to do this. Just use a real shell. A real shell has "pwd -P" to give you the physical path. Of course the default is "pwd -L".
>prasadshete: Bill i was just wondering to know what is
>The "chmod -R 777 *" club
>The "chown -R root:bin *" Club
Well, you don't want to join these clubs.
But since you're paid up member of the rm -rf club, you can get a very cut rate membership, provided you do it BEFORE you restore you broken system. :-)
>Yogeeraj: Nothing to worry about. It was just a joke!
It isn't a joke if you join the club.
Basically don't do those commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2008 09:26 AM
05-08-2008 09:26 AM
Re: problem after rm -rf *
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2008 10:19 AM
05-08-2008 10:19 AM
Re: problem after rm -rf *
> Heironimus: The problem with aliasing things to use "-i" is that it leads people to habitually use "-f".
As one who *prefers* to alias 'rm' to 'rm -i', I understand your comment. _However_, I look at the requirement to answer the prompt as a nice "are your sure?" that makes me think a fraction of a second before I commit.
If I have several files to remove, and I _do_ want to avoid the interactive prompts, I don't have any problem typing a few more characters to yield:
# /usr/bin/rm file1 file2 file3 ...
...which circumvents the interaction.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2008 02:56 PM
05-08-2008 02:56 PM
Re: problem after rm -rf *
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 07:01 PM
07-02-2008 07:01 PM
Re: problem after rm -rf *
I just thought of one way to do these normally dangerous experiments. Set up a chroot(1m).
After you have hosed yourself a few times, just "exit" back to the real world.
- Tags:
- chroot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2008 06:44 AM
07-07-2008 06:44 AM
Re: problem after rm -rf *
...
export LOG_DIR="blah"
...
cd $LGO_DIR
rm -fr *.*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2008 07:05 AM
07-07-2008 07:05 AM