Solved

chmod command

Posted on 2000-04-11
2
228 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

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…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

688 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