Summary Files Commits Branches @commit @diff @stats
path: root / src / talks
diff options
context:
space:
mode:
Commit727e8ebaee7400c080f5fa0e553b55817cba3d42 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-02-27 10:53:21 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-02-27 10:53:21 +0200
Filescc44918734725fdf9ccf6fe8b4765eb976dd2cab /src/talks
syndamia.com-727e8ebaee7400c080f5fa0e553b55817cba3d42.tar
syndamia.com-727e8ebaee7400c080f5fa0e553b55817cba3d42.tar.gz
syndamia.com-727e8ebaee7400c080f5fa0e553b55817cba3d42.zip
Parentfd34fa6d767a6461344682d4fc3f288ef64922d0 (diff)
[talks/lbs] Reworked files and directories slides, added some examples for files in /etc
1 files changed, 97 insertions, 65 deletions
-rw-r--r--src/talks/linuxgraphy-by-strabo/index.md162
diff --git a/src/talks/linuxgraphy-by-strabo/index.md b/src/talks/linuxgraphy-by-strabo/index.md
index 5ef6f99..b944584 100644
--- a/src/talks/linuxgraphy-by-strabo/index.md
+++ b/src/talks/linuxgraphy-by-strabo/index.md
@@ -940,44 +940,41 @@ Most modern shells support a lot of the more defying features of the [Bourne She
-&&slide
+&&clide &&font35
## 3.2. Files and directories
+- `/dev`: devices
+- `/proc`: process information
+
+&&lineb3
+
- `/bin`: main command programs (binaries), used by users
-- `/etc`: system configuration files
- `/sbin`: command programs, used for the system operation
- `/usr`: other system resources
+ `/usr/bin`: all other user command binaries
- + `/usr/lib`: library files
- + `/usr/local`: local, system software
- + `/usr/share`: architecture independent data, like manuals
-- `/var`: variable data, like logs and cache
-- `/dev`: devices
-- `/home`: home directories of all users
-- `/lib`: libraries and kernel modules
-- `/mnt`: mounted temporary filesystems
-- `/proc`: process information
-- `/root`: home directory for the root user
-&&/slide
+&&/font &&/clide
&&slide
-### General file system commands
+#### Everyday file system commands
- `mkdir`: create directories
- `rm`: remove a (hardlink to) file or directory
-- `shred`: overwrite file contents
- `mv`: move file (or directory) to another directory
- `cp`: copy a file
- `ln`: create hard (or soft, with `-s`) links to files (inodes)
- `ls`: list directory contents
+
+#### Other useful file system commands
+
+- `shred`: overwrite file contents
- `dd`: do many things with files, like modifying and duplicating data across devices and partitions, (basic) data recovery and generating files
- `du`: estimate file usage
-- `stat`: display status for file system or file system
+- `stat`: display status for file or file system
- `chwon`: change owner of an inode
- `chgrp`: change group of an inode
- `chmod`: change file modes
@@ -989,17 +986,20 @@ Most modern shells support a lot of the more defying features of the [Bourne She
&&slide
-### Working with text (files)
+#### Everyday text (file) commands
- `echo`: prints a given string to standard output
- `cat`: sequentially prints files to standard output
- `less`: view files with support for scrolling
-- `grep`: searches for matches in a file, using simplified regular expressions. Often there is `egrep`, which allows for extended regex and `fgrep` where strings are matched as-is.
+- `head`: print the first lines (or characters) of a file
+- `tail`: print the last lines (or characters) of a file
+
+#### Other useful text (file) commands
+
+- `grep`: searches for matches in a file, using simplified regular expressions. `egrep` for extended regex and `fgrep` for string match (as-is).
- `sed`: filter and transform text from files, according to regex
- `tr`: translate, map (more than one to one for example) and delete characters
- `cut`: remove parts of text from each line
-- `head`: print the first lines (or characters) of a file
-- `tail`: print the last lines (or characters) of a file
- `strings`: find embedded text inside binary files
- `truncate`: shrink or extend the size of a file
- `wc`: count words inside file
@@ -1009,87 +1009,119 @@ Most modern shells support a lot of the more defying features of the [Bourne She
-&&slide
+&&clide
-### Working with devices
+#### Device commands
- `mount`: bind another file system to a location in the file system
- `umount`: remove binding to a file system
+- `lsusb`: lists USB devices
+- `lspci`: lists PCI devices
-&&/slide
+#### System information commands
+- `date`: display current date and time
+- `hostname`: show (or set) the systems hostname (network name)
+- `free`: display free memory on the system
+&&/clide
-&&slide
-## 3.3 Common configuration files
-&&lineb1
+&&slide
-- `/etc/group`: the data for all groups is stored here, in the format
+#### User and group management
- ```
- GROUPNAME:PASSWORD:GID:USERS...
- ```
+- `useradd`: creates a new user (with a password)
+- `userdel`: remove a user and all of his files
+- `usermod`: modify a user account, including his name and groups
+- `passwd`: change password of a user. With `-l` user could be locked (impossible to log in)
-- `/etc/passwd`: the data for all users is stored here, in the format
+&&lineb1
- ```
- USERNAME:PASSWORD:UID:GID:USERINFO:HOMEDIR:SHELL
- ```
+- `groupadd`: create a new group
+- `groupdel`: remove a group
+- `groupmod`: modify an existing group
-- `/etc/shadow`: stores other user data, especially the password as an encrypted string, in the format
+&&lineb1
- ```
- USERNAME:PASSWORD:LASTCHANGED:MINBETWEENCHANGES:MAXBETWEENCHANGES:WARNEXPIRE:INACTIVEDAYS:EXPIRE
- ```
+- `w`: show who is logged in and what they are doing
+- `who`: show who is logged in
+- `whomai`: print username
+- `login`: establish a new connection to the system
&&/slide
-&&clide
+&&slide
-- `/etc/fstab`: mountings of devices to the file system, read on boot by mount
-- `/etc/hosts`: list of host names (domain names) and their corresponding IP address, when a DNS server doesn't do the job
-- `/etc/bashrc`: global defaults and aliases used by the bash shell
+- `/etc`: system configuration files
+ &&lineb2
-&&/clide
+ + `/etc/group`: the data for all groups is stored here, in the format
+ ```
+ GROUPNAME:PASSWORD:GID:USERS...
+ ```
+ + `/etc/passwd`: the data for all users is stored here, in the format
-&&slide
+ ```
+ USERNAME:PASSWORD:UID:GID:USERINFO:HOMEDIR:SHELL
+ ```
-## 3.4. System management
+ + `/etc/shadow`: stores other user data, especially the password as an encrypted string, in the format
-- System information
- + `date`: display current date and time
- + `hostname`: show (or set) the systems hostname (network name)
- + `free`: display free memory on the system
+ ```
+ USERNAME:PASSWORD:LASTCHANGED:MINBETWEENCHANGES:MAXBETWEENCHANGES:WARNEXPIRE:INACTIVEDAYS:EXPIRE
+ ```
&&/slide
-&&clide
+&&slide &&font27
-- Users and groups
- + `useradd`: creates a new user (with a password)
- + `userdel`: remove a user and all of his files
- + `usermod`: modify a user account, including his name and groups
- + `passwd`: change password of a user. With `-l` user could be locked (impossible to log in)
- &&lineb1
- + `groupadd`: create a new group
- + `groupdel`: remove a group
- + `groupmod`: modify an existing group
- &&lineb1
- + `w`: show who is logged in and what they are doing
- + `who`: show who is logged in
- + `whomai`: print username
- + `login`: establish a new connection to the system
+- &emsp;
+ + `/etc/fstab`: read on boot by mount to setup devices in fs
-&&/clide
+ ```
+ # device-spec mount-point fs-type options dump pass
+ /dev/sda1 / ext4 defaults 1 1
+ UUID=123A-456B /boot vfat noauto,noatime 1 2
+ LABEL=Vault /mnt/Vault auto nosuid,nodev,nofail 0 0
+ ```
+
+ + `/etc/hosts`: list of host names (domain names) and their corresponding IP address, when a DNS server doesn't do the job
+
+ ```
+ # ipaddress domains
+ 127.0.0.1 localhost mywebsite.com something.else
+ 62.44.101.138 my.uni
+ ```
+
+ + `/etc/bashrc`: global defaults and aliases used by the bash shell
+ + `/etc/motd`: message of the day (unexecuted text), shown after login but before the shell is ran
+
+&&/font &&/slide
+
+
+
+&&clide &&font35
+
+- `/usr`: other system resources
+ + `/usr/lib`: library files
+ + `/usr/local`: local, system software
+ + `/usr/share`: architecture independent data, like manuals
+- `/var`: variable data, like logs and cache
+- `/home`: home directories of all users
+- `/lib`: libraries and kernel modules
+- `/mnt`: mounted temporary filesystems
+- `/root`: home directory for the root user
+
+&&/font &&/clide