LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-20-2004, 12:45 AM   #1
Basslord1124
Member
 
Registered: Jun 2004
Location: Ashland, KY
Distribution: Debian, Puppy/Slacko
Posts: 351

Rep: Reputation: 31
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.
 
Old 07-20-2004, 12:54 AM   #2
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
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.
 
Old 07-20-2004, 12:56 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
chown -R

man chown
 
Old 07-20-2004, 01:00 AM   #4
afm
LQ Newbie
 
Registered: Jul 2004
Posts: 16

Rep: Reputation: 2
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
 
Old 07-20-2004, 01:10 AM   #5
Basslord1124
Member
 
Registered: Jun 2004
Location: Ashland, KY
Distribution: Debian, Puppy/Slacko
Posts: 351

Original Poster
Rep: Reputation: 31
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.
 
Old 07-20-2004, 01:40 AM   #6
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What can we do if we type chmod ugo-x /bin/chmod ?????? bunny123 Linux - Software 3 02-01-2005 09:53 PM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 06:37 AM
chmod +s or chmod -s excel28 Linux - General 1 09-30-2003 04:55 AM
How do u use chmod? Phonics3k Linux - General 3 06-19-2002 09:09 AM
chmod nabil Linux - General 3 06-23-2001 07:51 PM


All times are GMT -5. The time now is 11:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration