7 examples for chmod

{{ score }}
  # Allow my user (u) to "execute" (x) the file bro.rb
chmod u+x bro.rb
        
{{ score }}
  # allow only root access to a particular folder.  Useful for hiding your pr0n and any other files you don't want anyone else to see. 
sudo chmod -R 700 secret_folder
        
{{ score }}
  # Give everyone read, write and execute access to folder 'foo' and all its contents
chmod -R 777 foo
        
{{ score }}
  # Let rvm install gems without sudo.
# allow your (u)ser to (w)rite and e(x)ecute things in the /Library/Ruby directory, and (-R)ecursively below it
chmod -R u+wx /Library/Ruby
        
{{ score }}
  # Copy permissions from one file to another
chmod --reference=otherfile thisfile
        
{{ score }}
  # Give everyone read and execute access to folder 'foo' and all its contents
chmod -R 555 foo
        
{{ score }}
  # Recursively set All users with permissions to read files and execute directories.
# If the object is a directory the Executable Bit is added for all users: dr-xr-xr-x.
# If a file has an executable bit, execute is granted for All users: -r-xr-xr-x.
# If the file did not have an executable bit set, no executable bits are modified: -r--r--r--.
chmod -R a=rX testdir/