Solved

chmod command

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now