LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   some chmod questions... (https://www.linuxquestions.org/questions/linux-newbie-8/some-chmod-questions-207244/)

Basslord1124 07-19-2004 11:45 PM

some chmod questions...
 
Ok, I am working on using the chmod and chown commands. Here's what I have now. I have some files in my root directory that I copied over to my other username's directory. While doing this, all permissions stayed the same obviously. I was able to chown of the main directory but the subdirectories have the same permissions as before (from where they were from root)...and that's A LOT of subdirectories and files. Is there any quick way I can change permissions to all these at once rather than each folder/file separately.

frob23 07-19-2004 11:54 PM

chown -R

BE CAREFUL WITH THIS... you can screw things up. Make sure you are changing the directory you want. You should be careful with any command that recurses down the tree.

foo_bar_foo 07-19-2004 11:56 PM

chown -R

man chown

afm 07-20-2004 12:00 AM

Re: some chmod questions...
 
Quote:

Originally posted by Basslord1124
Is there any quick way I can change permissions to all these at once rather than each folder/file separately.
chown -R user /path/to/directory

This command will change ownership of /path/to/directory and any file/directory downward to user user.

Further RTFM: the chown man page

Basslord1124 07-20-2004 12:10 AM

k, thanks....and yeah I am being careful. I only copied everything from my root directory over, so the original files will still be in the right place. Most of the copies will get deleted (noticed a lot of ./ type of directories), but I just wanna get a few files from here. Still, it's given me a chance to screw around with command line which was my reason.

frob23 07-20-2004 12:40 AM

You'll note that most people tend to be very careful when advising others to use recursive commands. Even where the risks are light...

For example, if you accidentally chown -R 'ed someone's home directory... you could easily fix it by repeating the command with their name. But if you chown -R 'd /usr/bin ... that would ruin tons of stuff. I recommend the "Unix Horror Stories" as required reading for anyone who is going to spend any amount of time as root on a *nix box. Lot's of examples of what NOT to do.


All times are GMT -5. The time now is 06:07 PM.