emma_bash - Anton-L-GitHub/Learning GitHub Wiki
- A program that takes your commands and executes them via the OS.
Path | Expl |
---|---|
/home/user/Desktop |
Absolute path from root directory |
/folder |
Relative path from current position |
- When executing a command the reply or output is displayed on the screen by default.
- The output can be redirected to a file instead:
echo Hello World > filename.Example
- When writing a command the standard input is by default from the keyboard.
- The input can also come from a file or output from a process:
cat < filename.Example
- Error messages will be displayed on the screen by default, even if the command says to redirect the output.
- To redirect error messages we have to use file descriptors:
ls /nonworking/directory 2> filename.Example
- To manage access, permissions and ownership of files and processes.
- Users home directory
/home/username
- Groups are sets of users with permissions
- User ID
- To manage and identify users
- Checkout users and IDs in
/etc/passwd
- Group ID
- To manage and identify groups
- Checkout groups in
/etc/group
User | Expl | Commad |
---|---|---|
User |
regular human user | |
Daemon |
runs processes to keep system functioning | |
Root/Superuser |
most powertful user in entire system, can do anything | `sudo |
- Superuser
- Who can run sudo? Everyone in
/etc/sudoers
- Where users and IDs are stored
- Example:
root:x:0:0:root:/root:/bin/bash
Field | Expl | Note |
---|---|---|
1 | username | |
2 | encrypted user password |
x -Password stored in /etc/shadow |
* -No login access |
||
3 | UID (user id) |
0 -Root has UID 0 |
4 | GID (group id) | |
5 | GECOS (used for comments and info) |
, -The info is comma delimited |
6 | users home directory | |
7 | users shell |
- Stores encrypted password and information about user authentication
- Obs! Requires superuser read permissions
- Example:
root:MyEPTEa$6Nonsense:15000:0:99999:7:::
Field | Expl | Note |
---|---|---|
1 | username | |
2 | encrypted user password | |
3 | date of last password change |
0 -User should change password at next login |
4 | min number of days before user can change password again | |
5 | max number of days before user has to change password | |
6 | number of days before password expires | |
7 | number of days after password expiration to allow login again | |
8 | account expiration date | |
9 | reserved field for future |
- Stores groups and group members
- Example:
root:*:0:pete
Field | Expl | Note |
---|---|---|
1 | group name | |
2 | group password (not needed, use sudo ) |
* -No password needed, asterisk is default |
3 | GID (group ID) | |
4 | list of users |
- Files have different permissions
- Checkout the permissions of a file with
ls -l <filename>
- Example:
drwxr-xr-x 2 pete penguins 4096 Dec 1 11:45 .
- Broken down:
d | rwx | r-x | r-x
Field | Expl | Note |
---|---|---|
1 | filetype |
d -Directory |
- -Regular file |
||
2 | user permissions | |
3 | group permissions | |
4 | others permissions |
Symbol | Expl | Note |
---|---|---|
r |
filetype |
d -Directory |
- -Regular file |
||
`` | user permissions | |
3 | group permissions | |
4 | others permissions |