Go Back   PCMech Forums > Linux Support > Linux OS and Software Assistance

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 03-26-2002, 06:08 PM   #1
Member (8 bit)
 
Join Date: Jan 2000
Posts: 142
Question Help Please! Changing permissions with chmod!?!?

How can I change permissions (owner, group, other) with chmod in such a way so that when I change the permissions for a directory the permissions for all of its contents (files, sub directories, etc) change as well? I know that it can be done is KDE but what about using chmod on command line? Thanks! Leo.
lsakhvoruk is offline   Reply With Quote
Old 03-26-2002, 10:20 PM   #2
Member (11 bit)
 
Computer Hobbyist's Avatar
 
Join Date: Feb 2001
Location: Blue Springs, MO
Posts: 1,766
Re: Help Please! Changing permissions with chmod!?!?

Quote:
Originally posted by lsakhvoruk
How can I change permissions (owner, group, other) with chmod in such a way so that when I change the permissions for a directory the permissions for all of its contents (files, sub directories, etc) change as well? I know that it can be done is KDE but what about using chmod on command line? Thanks! Leo.
chmod is intended to be used at the command line. The following operates recursively, changing the access mode of subdirectories and files beneath a specified directory.

chmod -R mode files

Changes in ownership of specified files are accomplished by the command chown.

chown -R userid files operates recursively, changing the owner of the subdirectories and files beneath a specified directory.

I nearly forgot, changes in group are accomplished with the command chgrp. Recursive changes follow the above syntax-- chgrp -R group files

The group must be named in the /etc/groups file, maintained by the newgroup command.

One final thing, if you want to learn more about chmod open a terminal and type man chmod. It will tell you all you need to know about using chmod at the command line. An alternative is to type chmod --help at the command line.

CH

Last edited by Computer Hobbyist; 03-27-2002 at 12:42 AM.
Computer Hobbyist is offline   Reply With Quote
Old 03-28-2002, 07:24 AM   #3
Premium Member
 
Statica's Avatar
 
Join Date: Jun 1999
Posts: 9,231
you could use:

find . -type d -exec chmod ### {} \;
to change permissions of all directories & sub-directories to whatever you want recursively

find . -type f -exec chmod ### {} \;
to do the same for files.

Along with chown& chmod, do u remember to use chattr? that is a very useful attribute that most forget.
Statica is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:22 PM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0