zmontano69
01-22-2004, 06:50 AM
anyone know?
i know that if you need to chown a directory you go:
chown username.[nobody] /path
[nobody] is an example... but how do you chown a directory and all files + directories beneath it with one command?
Winkie
01-22-2004, 07:00 AM
chown -R <username> /path
-R for Recursive
Ramprage
01-22-2004, 11:53 AM
Be VERY careful with the Recursive attribute!
EG: Doing THIS IS BAD !!!!# chown -R nobody.nobody /
When you mean to do the current directory would do the / root directory and ALL subfolders/files, screwing all set users and groups!
Just thought I'd give you a heads up :)
hostito
01-22-2004, 12:03 PM
Funny how simple things can be so destructive when you are root ;)
I agree, watch out where you are and double check what you chown.
Winkie
01-22-2004, 12:06 PM
^^ The other day I did a huge long rm -rf and accidentally put a space between linux and *, so I deleted everything by mistake
zmontano69
01-26-2004, 03:52 AM
thanks for teh help and advice
i just hope that i don't end up looking like :eek: after finding out i messed up... GULP!!!
TheVoice
01-26-2004, 06:45 PM
When doing anything recursively make sure you are directly above the directory you are taking action on. For example if you want to remove /home/username DO NOT type rm -rf /home/username instead do cd /home/ then rm -rf username. This will ensure you don't delete full file structures by accident.
Andrew
01-26-2004, 06:48 PM
And always pay attention to what you're doing. Don't let someone distract you.
Happened to me once...ended up nuking /usr/local/apache/conf instead of deleting the core files in /usr/local/apache...that was a fun time restoring that mess. :D