Administration
  Home arrow Administration arrow Page 3 - CHMOD: Tool for Open Source Administra...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

CHMOD: Tool for Open Source Administration
By: Drew Decker
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 29
    2005-12-05

    Table of Contents:
  • CHMOD: Tool for Open Source Administration
  • chmod Reasoning
  • Switches
  • Modes
  • Mentally Converting from “read/write/execute” to 777

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    FaxWave - Free Trial.
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    CHMOD: Tool for Open Source Administration - Switches
    (Page 3 of 5 )

    Switches are also known as line options in Linux. These line options are used to get output by the main command (our case being the chmod command). I’m going to explain only two switches, but remember, there are many resources out there that can show you more switches. The switches are the -R (Recursive) and -v (verbose) switches. NOTE: UNIX/Linux is case-sensitive!

    The -R (Recursive) switch is a very powerful switch. It allows you to recursively (ahh, that’s why they call it that!) command the chmod command to not only change the mode to the directory you specify, but also the directory’s subfolders. As I said, it is very useful. Suppose that we have a folder called Test and it has four sub-directories called: Production, Alpha, Beta, and PR, respectively. The problem is, we are limited in time, and we have to make these kinds of changes on a Linux machine to about 400 other Linux machines, so we have to be able to do it fast.

    GUIs (Graphical User Interface) are cute, but also very slow. A directory at a time is still slow, even though it is much faster than using a GUI. So our only alternative is to use the -R switch for chmod; remember we are changing modes. Let’s see how we would do this in an example:

    Bash

    • chmod -R 755 /Test

    What we are doing here is telling the chmod command to give the owner Read, Write, and Execute permissions. Groups that are assigned to the file get Read and Execute permissions; World (other) also gets Read and Execute permissions. We will go into modes later. While giving permissions to the three types on objects, we are telling it to do this to the Test directory and all of its sub-directories.

    Next I will discuss using the -v (verbose) switch. This is probably one of my favorite (still useful) commands that UNIX/Linux has, and is usually used for a lot of different commands. The -v (Verbose) switch just outputs what the chmod command is doing. It tells you it is assigning permissions, to each directory, where it is, and any errors is has along the way.

    Again, suppose that we have a folder called Test and it has four sub-directories called: Production, Alpha, Beta, and PR, respectively. To really show you output of this, you should try it out for yourself. It’s neat, but looks crazy. You would use the -v (verbose) switch in case you are a computer nut and want to just see what’s happening, need to find out why something isn’t working (troubleshooting), or need to just make sure everything is doing what it is suppose to be doing. Let’s see how we would do this in an example:

    Bash

    • chmod -v 755 /Test

    Before I go any further, remember what I said about case-sensitivity; I meant it, so be aware. Since you should know what the above example is saying, I’ll be brief. The only difference with this command is it displays everything that is happening from the chmod command’s start to end. Everything else is the same. If you need to read over this section again, please do; we are now going into the really fun part, modes.

    More Administration Articles
    More By Drew Decker


       · Darwin Linux???
       · You mean "octal", i.e., base 8. Why spend so much wordage introducing IPs and octets...
       · should be darwin linux :D!
       · I have my way of explaining things. Is it because I'm 19 or it because I'm full of...
     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway