rm -rf $Home (was GNOME hangs)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> .... I was advised to do something
>>> which turned out to be disastrous so NEVER EVER issue the following from
>>> a root shell
>>>
>>> rm -rf $Home/*
>>>
>>
>> Are you sure you executed the command above ? This would mean you
>> deleted the /root directory and all its contents. Are you sure you
>> didn't delete your personal home dir and everything in it ?

Actually as the above command is written, it would have deleted everything under /,
not /root. $Home is not set, but $HOME.

I've seen some scripts with the following:

LOGDIR=/var/log/myapp
cd $LOGDIR
rm -rf *

If for some reason LOGDIR is inaccessible then the script owners $HOME is likely to
be trashed. On some systems where root's home is not /root, then likely everything
in / gets trashed.


>> Anyway, I guess you've learned your lesson, don't just copy and execute
>> commands (especially rm commands) from a root shell.

Which is incredibly good advice for any system...
-- 
* The Digital Hermit   http://www.digitalhermit.com
* Unix and Linux Solutions   kwan@xxxxxxxxxxxxxxxxx


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux