Linux 2 Flashcards
1
Q
Superuser
A
- The account with total control over the operating system and has permissions to do anything and everything.
- There is always at least one superuser account on every Linux system, and the account name is usually called ‘root’.
- On Linux, the root account can do absolutely anything it likes, even up to and including breaking the operating system. Delete the whole file system? Sure, all gone. You’re root, so you’re allowed to do that.
2
Q
Sudo Command
A
- Allows you to temporarily take control of root privileges for a command and then drops your permissions back down once finished.
- The way ‘sudo’ works is there is a configuration file called the ‘sudoers’ file, which is basically a list of which accounts are allowed to do what with superuser privileges (and only root can edit it).
- When you want to run a command with privileges, you append ‘sudo’ before the command.
3
Q
File Permissions
A
- There are three permission modes which can be set for each owner of the file.
r: Read Permissions
w: Write Permissions
x: Execute Permissions (if it’s an executable, then you can execute it)
- Permissions are listed as ‘———-‘
The first ‘-‘ is reserved for special permissions or to indicate if this is a directory or a file.
The next three ‘-‘ are reserved for user permissions.
The three ‘-‘ after user perms are for group permissions
The last three ‘-‘ are for anyone else who isn’t the user owner/group owner.
- Shorthand binary form for perms:
Read = 4 Write = 2 Execute = 1
e.g. 4+2 = 6 -> 110 is r+w perms
4
Q
Environment Variables
A
- Denoted by the ‘$’ sign.
- You can set/modify one with the ‘export’ command.
e. g. ‘export VAR=XX’ where VAR (no $) is the variable and XX is the data you want to assign. - The PATH environment variable contains a list of directory paths separated by a colon (:) which tells the terminal where to look for the equivalent binary executable when you type that command.
- The ‘which’ command can show us where a program is installed on our system.