Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

chmod command

Posted on 2000-04-11
2
Medium Priority
?
230 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 300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.
Suggested Courses

650 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