Post

Cheatsheet for Linux

Ownership

1
2
3
4
sudo chown $USER:$USER fileName

sudo chown $USER:$USER folderName
sudo chown -R $USER:$USER folderName //Modifies the files inside

File Permission

There are three permissions: Read: 4 Write 2 Execute 1 or rwx

1
2
3
4
5
6
chmod 777 fileName
chmod +rwx fileName
chmod -rwx fileName

chmod 755 folderName
chmod -R 755 folderName  // Modifies the files inside

Defaults:

  1. General Folder: 775
  2. General File: 664
  3. Deployment Folder: 755
  4. Deployment File: 644

Tips:

Executing scripts without entering password

1
2
sudo visudo #or sudo nano /etc/sudoers
userName ALL=(ALL) NOPASSWD: /pathToScript # add to the eof
This post is licensed under CC BY 4.0 by the author.