Solved

chmod command

Posted on 2000-04-11
2
227 Views
Last Modified: 2010-04-20
Setting permissions through directories..

i.e.

How can I change the permissions for
subdir1 & 2 and the 4 files at once?
(all to 777)

maindir/subdir1/file1
maindir/subdir1/file2
maindir/subdir2/file1
maindir/subdir2/file2
0
Comment
Question by:Karina051699
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
dserna earned 100 total points
ID: 2706005
You could do:
: dserna@ns:~/maindir: cd /maindir
: dserna@ns:~/maindir: pwd
/maindir
: dserna@ns:~/maindir: chmod -R 777 *
: dserna@ns:~/maindir: ls -al
total 12
drwxr-xr-x   4 dserna   sysadmin     512 Apr 11 17:46 .
drwxr-xr-x  27 dserna   sysadmin    3072 Apr 11 17:46 ..
drwxrwxrwx   2 dserna   sysadmin     512 Apr 11 17:46 subdir1
drwxrwxrwx   2 dserna   sysadmin     512 Apr 11 17:46 subdir2
: dserna@ns:~/maindir: ls -al subdir1
total 4
drwxrwxrwx   2 dserna   sysadmin     512 Apr 11 17:46 .
drwxr-xr-x   4 dserna   sysadmin     512 Apr 11 17:46 ..
-rwxrwxrwx   1 dserna   sysadmin       0 Apr 11 17:46 file1
-rwxrwxrwx   1 dserna   sysadmin       0 Apr 11 17:46 file2
: dserna@ns:~/maindir: ls -al subdir2
total 4
drwxrwxrwx   2 dserna   sysadmin     512 Apr 11 17:46 .
drwxr-xr-x   4 dserna   sysadmin     512 Apr 11 17:46 ..
-rwxrwxrwx   1 dserna   sysadmin       0 Apr 11 17:46 file1
-rwxrwxrwx   1 dserna   sysadmin       0 Apr 11 17:46 file2
: dserna@ns:~/maindir:


Hope that helps.

-Daniel-
0
 
LVL 3

Expert Comment

by:DVB
ID: 2709645
Uhh, how about man (or info)chmod first please? chmod -R or chmod --recursive.
From the chmod man page:
-R, --recursive              change files and directories recursively    
dserna has got the answer anyway, so (s)he deserves the points. I posted just to make the solution stand out.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question