LPIC Course
LPIC Course
none.
8 of 60 12 of 60
Exam Objectives
26 of 60 14 of 60
60 Multiple-choice Online
and fill in the proctored and
blank in-person
Determine and Configure
Hardware Settings
BIOS/UEFI
>_
$ sudo lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
00:0c.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 02)
Inspecting Devices in Linux
>_
$ sudo lspci -s 00:03.0 -v
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
>_
$ sudo lspci -s 00:03.0 -k
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
>_
$ sudo lsusb
Bus 001 Device 029: ID 1781:0c9f Multiple Vendors USBtiny
Bus 001 Device 028: ID 093a:2521 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 020: ID 1131:1001 Integrated System Solution Corp. KY-BT100
Bluetooth Adapter
Bus 001 Device 011: ID 04f2:0402 Chicony Electronics Co., Ltd Genius LuxeMate i200
Keyboard
Bus 001 Device 007: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Inspecting Devices in Linux
>_
$ sudo lsusb -v -d 1781:0c9f
Bus 001 Device 029: ID 1781:0c9f Multiple Vendors USBtiny
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.01
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1781 Multiple Vendors
idProduct 0x0c9f USBtiny
bcdDevice 1.04
iManufacturer 0
iProduct 2 USBtiny
iSerial 0
bNumConfigurations 1
Inspecting Devices in Linux
>_
$ sudo lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/3p, 480M
|__ Port 2: Dev 11, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 11, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 20, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 20, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 20, If 2, Class=Application Specific Interface,Driver=, 12M
|__ Port 1: Dev 7, If 0, Class=Vendor Specific Class, Driver=lan78xx, 480M
|__ Port 2: Dev 28, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 29, If 0, Class=Vendor Specific Class, Driver=, 1.5M
Inspecting Devices in Linux
>_
$ sudo lsusb -s 01:20
Bus 001 Device 020: ID 1131:1001 Integrated System Solution Corp. KY-BT100
Bluetooth Adapter
Kernel Modules
>_
$ sudo lsmod
Module Size Used by
tls 110592 0
uinput 20480 0
nls_utf8 16384 1
isofs 49152 1
snd_seq_dummy 16384 0
snd_hrtimer 16384 1
>_
$ sudo lsmod | fgrep -i snd
snd_seq_dummy 16384 0
snd_hrtimer 16384 1
>_
$ sudo modprobe -r snd-hda-intel
Kernel Modules
>_
$ sudo modinfo snd
filename: /lib/modules/5.14.0-70.26.1.el9_0.x86_64/kernel/sound/core/snd.ko.xz
alias: char-major-116-*
license: GPL
>_
/etc/modprobe.conf
$ sudo modinfo -p snd
max_user_ctl_alloc_size:Max allocation size for user controls (int)
/etc/modprobe.d/snd.conf
slots:Module names assigned to the slots. (array of charp)
/etc/modprobe.d/blacklist.conf
major:Major # for sound driver. (int)
/proc
/sys
Special directories that exist in RAM
Used by the kernel to store information on running processes
Boot the System
Boot the System
BIOS
or
UEFI
Bootloader
Kernel
Init
BIOS
NVRAM
EFI applications
FAT filesystems or ISO-9660
EFI System Partition (ESP)
EFI directory
UEFI
BIOS SHIFT
UEFI ESC
Bootloader
>_
$ dmesg
[ 5.262389] EXT4-fs (sda1): mounted filesystem with ordered data mode.
Opts:
(null)
[ 5.449712] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 5.460286] systemd[1]: systemd 237 running in system mode.
[ 5.480138] systemd[1]: Detected architecture x86-64.
[ 5.481767] systemd[1]: Set hostname to <torre>.
[ 5.636607] systemd[1]: Reached target User and Group Name Lookups.
[ 5.636866] systemd[1]: Created slice System Slice.
[ 5.637000] systemd[1]: Listening on Journal Audit Socket.
[ 5.637085] systemd[1]: Listening on Journal Socket.
[ 5.637827] systemd[1]: Mounting POSIX Message Queue File System...
[ 5.638639] systemd[1]: Started Read required files in advance.
[ 5.641661] systemd[1]: Starting Load Kernel Modules...
[ 5.661672] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro
[ 5.694322] lp: driver loaded but no devices found
[ 5.702609] ppdev: user-space parallel port driver
[ 5.705384] parport_pc 00:02: reported by Plug and Play ACPI
[ 5.705468] parport0: PC-style at 0x378 (0x778), irq 7, dma 3
[PCSPP,TRISTATE,COMPAT,EPP,ECP,DMA]
[ 5.800146] lp0: using parport0 (interrupt-driven).
[ 5.897421] systemd-journald[352]: Received request to flush runtime
journal
from PID 1
Init
>_
$ journalctl --list-boots
-4 9e5b3eb4952845208b841ad4dbefa1a6 Thu 2019-10-03 13:39:23 -03—Thu 2019-
10-03
13:40:30 -03
-3 9e3d79955535430aa43baa17758f40fa Thu 2019-10-03 13:41:15 -03—Thu 2019-
10-03
14:56:19 -03
-2 17672d8851694e6c9bb102df7355452c Thu 2019-10-03 14:56:57 -03—Thu 2019-
10-03
19:27:16 -03
-1 55c0d9439bfb4e85a20a62776d0dbb4d Thu 2019-10-03 19:27:53 -03—Fri 2019-
10-04
00:28:47 -03
0 08fbbebd9f964a74b8a02bb27b200622 Fri 2019-10-04 00:31:01 -03—Fri 2019-
10-04
10:17:01 -03
Init
>_
$ journalctl -b 0
oct 04 00:31:01 ubuntu-host kernel: EXT4-fs (sda1): mounted filesystem
with ordered
data mode. Opts: (null)
oct 04 00:31:01 ubuntu-host kernel: ip_tables: (C) 2000-2006 Netfilter
Core Team
oct 04 00:31:01 ubuntu-host systemd[1]: systemd 237 running in system
mode.
oct 04 00:31:01 ubuntu-host systemd[1]: Detected architecture x86-64.
oct 04 00:31:01 ubuntu-host systemd[1]: Set hostname to <torre>.
oct 04 00:31:01 ubuntu-host systemd[1]: Reached target User and Group Name
Lookups.
oct 04 00:31:01 ubuntu-host systemd[1]: Created slice System Slice.
oct 04 00:31:01 ubuntu-host systemd[1]: Listening on Journal Audit Socket.
oct 04 00:31:01 ubuntu-host systemd[1]: Listening on Journal Socket.
oct 04 00:31:01 ubuntu-host systemd[1]: Mounting POSIX Message Queue File
System...
oct 04 00:31:01 ubuntu-host systemd[1]: Started Read required files in
advance.
oct 04 00:31:01 ubuntu-host systemd[1]: Starting Load Kernel Modules...
oct 04 00:31:01 ubuntu-host kernel: EXT4-fs (sda1): re-mounted. Opts:
commit=300,barrier=0,errors=remount-ro
oct 04 00:31:01 ubuntu-host kernel: lp: driver loaded but no devices found
oct 04 00:31:01 ubuntu-host kernel: ppdev: user-space parallel port driver
oct 04 00:31:01 ubuntu-host kernel: parport_pc 00:02: reported by Plug and
Play
Init
>_
/var/log/ Initialization and system logs.
$ journalctl -D /var/log/other_directory
Change Runlevels
and Boot Targets
SysVinit
id:runlevels:action:process
wait Executed for the given runlevels. Init waits until finished.
>_ /etc/inittab
$ sudo vi /etc/inittab # Default runlevel
id:3:initdefault:
# Configuration script executed during boot
$ sudo telnit q si::sysinit:/etc/init.d/rcS
# Action taken on runlevel S (single user)
~:S:wait:/sbin/sulogin
# Configuration for each execution level
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Action taken upon ctrl+alt+del keystroke
ca::ctrlaltdel:/sbin/shutdown -r now
# Enable consoles for runlevels 2 and 3
1:23:respawn:/sbin/getty tty1 VC linux
2:23:respawn:/sbin/getty tty2 VC linux
3:23:respawn:/sbin/getty tty3 VC linux
4:23:respawn:/sbin/getty tty4 VC linux
# For runlevel 3, also enable serial
# terminals ttyS0 and ttyS1 (modem) consoles
S0:3:respawn:/sbin/getty -L 9600 ttyS0 vt320
S1:3:respawn:/sbin/mgetty -x0 -D ttyS1
SysVinit
$ runlevel
N 3
$ sudo telinit 1
systemd
>_
$ sudo systemctl start unit.service
>_
$ sudo systemctl isolate multi-user.target
>_
$ sudo start tty6
>_
$ sudo shutdown [option] time [message]
4GB
>_
$ swapon --show
NAME TYPE SIZE USED PRIO
/dev/dm-1 partition 2G 0B -2
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 8:0 0 20G 0 disk
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
├─cs-root 253:0 0 17G 0 lvm /
└─cs-swap 253:1 0 2G 0 lvm [SWAP]
vdb 8:16 0 10G 0 disk
├─vdb1 8:17 0 4G 0 part
├─vdb2 8:18 0 4G 0 part
└─vdb3 8:19 0 2G 0 part
Create and Manage Swap Space
>_
$ sudo mkswap /dev/vdb3
Setting up swapspace version 1, size = 2 GiB (2146430976 bytes)
no label, UUID=6d6f451e-5fa4-4cd5-b627-b0f39c810002
$ swapon --show
NAME TYPE SIZE USED PRIO
/dev/dm-1 partition 2G 0B -2
/dev/vdb3 partition 2G 0B -3
Create and Manage Swap Space
>_
$ sudo swapoff /dev/vdb3
>_
$ sudo mkswap /swap
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=cff8e9dc-54fa-4661-a48e-497610b2f07b
$ swapon --show
NAME TYPE SIZE USED PRIO
/dev/dm-1 partition 2G 268K -2
/swap file 2G 0B -3
GRUB Legacy
Install GRUB Legacy
>_
$ sudo grub-install /dev/sda
>_
c
grub> root (hd0,0)
>_ /boot/grub/menu.lst
>_ /boot/grub/menu.lst
# Load Windows
title Windows XP
root (hd0,1)
makeactive
chainload +1
boot
Manage Shared Libraries
Libraries
Compiler : turns the source code into machine code stored in object files
>_ soname
$ ls -l /lib/x86_64-linux-gnu/libc.so.6 Library name (lib prefix)
rwxrwxrwx 1 root root 12 feb 6 22:17 /lib/x86_64-linux-gnu/libc.so.6 ->
libc-2.24.so so (shared object)
Version number
Example: libpthread.so.0
Example: libpthread.a
Common Locations
/lib
/lib32
/lib64
/usr/lib
/usr/local/lib
Configure Shared Library Paths
$ ls /etc/ld.so.conf.d/
libc.conf x86_64-linux-gnu.conf
$ cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf
# Multiarch support
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
ldconfig
>_
$ sudo ldconfig -v
/usr/local/lib:
/lib/x86_64-linux-gnu:
libnss_myhostname.so.2 -> libnss_myhostname.so.2
libfuse.so.2 -> libfuse.so.2.9.7
libidn.so.11 -> libidn.so.11.6.16
libnss_mdns4.so.2 -> libnss_mdns4.so.2
libparted.so.2 -> libparted.so.2.0.1
(...)
ldconfig
>_
$ sudo ldconfig -p
1094 libs found in the cache `/etc/ld.so.cache'
libzvbi.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libzvbi.so.0
libzvbi-chains.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libzvbi-chains.so.0
libzmq.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libzmq.so.5
libzeitgeist-2.0.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libzeitgeist-2.0.so.0
(...)
$ ls -l /lib/x86_64-linux-gnu/libfuse.so.2
lrwxrwxrwx 1 root root 16 Aug 21 2018 /lib/x86_64-linux-gnu/libfuse.so.2 ->
libfuse.so.2.9.7
ldconfig
>_
$ LD_LIBRARY_PATH=/usr/local/mylib
$ echo $LD_LIBRARY_PATH
/usr/local/mylib
$ export LD_LIBRARY_PATH=/usr/local/mylib
$ unset LD_LIBRARY_PATH
>_
$ ldd /usr/bin/git
linux-vdso.so.1 => (0x00007ffcbb310000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f18241eb000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1823fd1000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f1823db6000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1823b99000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1823991000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f18235c7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f182445b000)
$ ldd /lib/x86_64-linux-gnu/libc.so.6
/lib64/ld-linux-x86-64.so.2 (0x00007fbfed578000)
linux-vdso.so.1 (0x00007fffb7bf5000)
$ ldd -u /usr/bin/git
Unused direct dependencies:
/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libpthread.so.0
/lib/x86_64-linux-gnu/librt.so.1
Debian Package Management: dpkg
dpkg
Early software: source code in compressed files like .tar and .gz
Debian package format uses .deb files and the package tool dpkg
dpkg
>_
$ sudo dpkg -i mypackage.deb
dpkg
>_ fonts-cantarell
$ sudo dpkg -i openshot-qt_2.4.3+dfsg1-1_all.deb python3-openshot
(Reading database ... 269630 files and directories currently installed.)
Preparing to unpack openshot-qt_2.4.3+dfsg1-1_all.deb ...
Unpacking openshot-qt (2.4.3+dfsg1-1) over (2.4.3+dfsg1-1) ...
python3-pyqt5
dpkg: dependency problems prevent configuration of openshot-qt:
openshot-qt depends on fonts-cantarell; however: python3-pyqt5.qtsvg
Package fonts-cantarell is not installed.
openshot-qt depends on python3-openshot; however:
Package python3-openshot is not installed. python3-pyqt5.qtwebkit
openshot-qt depends on python3-pyqt5; however:
Package python3-pyqt5 is not installed.
openshot-qt depends on python3-pyqt5.qtsvg; however:
python3-zmq
Package python3-pyqt5.qtsvg is not installed.
openshot-qt depends on python3-pyqt5.qtwebkit; however:
Package python3-pyqt5.qtwebkit is not installed.
openshot-qt depends on python3-zmq; however:
Package python3-zmq is not installed.
dpkg: error processing package openshot-qt (--install):
dependency problems - leaving unconfigured
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for gnome-menus (3.32.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-4ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.8.5-2) ...
Errors were encountered while processing:
openshot-qt
dpkg
>_
$ sudo dpkg -r unrar
(Reading database ... 269630 files and directories currently installed.)
Removing unrar (1:5.6.6-2) ...
Processing triggers for man-db (2.8.5-2) ...
>_
$ sudo dpkg -r unrar p7zip
>_
$ sudo dpkg -I google-chrome-stable_current_amd64.deb
new Debian package, version 2.0.
size 59477810 bytes: control archive=10394 bytes.
1222 bytes, 13 lines control
16906 bytes, 457 lines * postinst #!/bin/sh
12983 bytes, 344 lines * postrm #!/bin/sh
1385 bytes, 42 lines * prerm #!/bin/sh
Package: google-chrome-stable
Version: 76.0.3809.100-1
Architecture: amd64
Maintainer: Chrome Linux Team <[email protected]>
Installed-Size: 205436
Pre-Depends: dpkg (>= 1.14.0)
Depends: ca-certificates, fonts-liberation, libappindicator3-1, libasound2 (>=
1.0.16), libatk-bridge2.0-0 (>= 2.5.3), libatk1.0-0 (>= 2.2.0), libatspi2.0-0 (>=
2.9.90), libc6 (>= 2.16), libcairo2 (>= 1.6.0), libcups2 (>= 1.4.0), libdbus-1-3
(>= 1.5.12), libexpat1 (>= 2.0.1), libgcc1 (>= 1:3.0), libgdk-pixbuf2.0-0 (>=
2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.9.10), libnspr4 (>= 2:4.9-2~),
libnss3 (>= 2:3.22), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.14.0),
libuuid1 (>= 2.16), libx11-6 (>= 2:1.4.99.1), libx11-xcb1, libxcb1 (>= 1.6),
libxcomposite1 (>= 1:0.3-1), libxcursor1 (>> 1.1.2), libxdamage1 (>= 1:1.1),
libxext6, libxfixes3, libxi6 (>= 2:1.2.99.4), libxrandr2 (>= 2:1.2.99.3),
libxrender1, libxss1, libxtst6, lsb-release, wget, xdg-utils (>= 1.0.2)
Recommends: libu2f-udev
Provides: www-browser
Section: web
Priority: optional
Description: The web browser from Google
Google Chrome is a browser that combines a minimal design with sophisticated
technology to make the web faster, safer, and easier.
dpkg
>_
$ sudo dpkg --get-selections
>_
$ sudo dpkg-recongifure tzdata
Debian Package Management: apt
APT
Features:
• Advanced search and automatic dependency resolution
• Not a substitute for dpkg (Think of this as a front end)
• Works with software repositories
• Repositories may be local, a remote server, or a CD-ROM
• Distributions like Debian and Ubuntu maintain their own
repositories
• Other repositories are maintained by users or groups to provide
software not available in the main distribution repositories
APT
>_
$ sudo apt-get Download, install, upgrade, and remove
>_
$ sudo apt-get update
apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 https://repo.skype.com/deb stable InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu disco InRelease
Hit:4 http://repository.spotify.com stable InRelease
Hit:5 http://dl.google.com/linux/chrome/deb stable Release
Hit:6 http://apt.pop-os.org/proprietary disco InRelease
Hit:7 http://ppa.launchpad.net/system76/pop/ubuntu disco InRelease
Hit:8 http://us.archive.ubuntu.com/ubuntu disco-security InRelease
Hit:9 http://us.archive.ubuntu.com/ubuntu disco-updates InRelease
Hit:10 http://us.archive.ubuntu.com/ubuntu disco-backports InRelease
Reading package lists... Done
APT
>_
$ sudo apt-get install xournal
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
xournal
0 upgraded, 1 newly installed, 0 to remove and 75 not upgraded.
Need to get 285 kB of archives.
After this operation, 1041 kB of additional disk space will be used.
APT
>_
$ sudo apt-get remove xournal
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
xournal
0 upgraded, 0 newly installed, 1 to remove and 75 not upgraded.
After this operation, 1041 kB disk space will be freed.
Do you want to continue? [Y/n]
APT
>_
$ sudo apt-get remove p7zip
Reading package lists... Done
Building dependency tree
The following packages will be REMOVED:
android-libbacktrace android-libunwind android-libutils
android-libziparchive android-sdk-platform-tools fastboot p7zip p7zip-full
0 upgraded, 0 newly installed, 8 to remove and 75 not upgraded.
After this operation, 6545 kB disk space will be freed.
Do you want to continue? [Y/n]
>_
$ sudo dpkg -i --force openshot-qt_2.4.3+dfsg1-1_all.deb
(Reading database ... 269630 files and directories currently installed.)
Preparing to unpack openshot-qt_2.4.3+dfsg1-1_all.deb ...
Unpacking openshot-qt (2.4.3+dfsg1-1) over (2.4.3+dfsg1-1) ...
dpkg: dependency problems prevent configuration of openshot-qt:
openshot-qt depends on fonts-cantarell; however:
Package fonts-cantarell is not installed.
openshot-qt depends on python3-openshot; however:
Package python3-openshot is not installed.
openshot-qt depends on python3-pyqt5; however:
Package python3-pyqt5 is not installed.
openshot-qt depends on python3-pyqt5.qtsvg; however:
Package python3-pyqt5.qtsvg is not installed.
openshot-qt depends on python3-pyqt5.qtwebkit; however:
Package python3-pyqt5.qtwebkit is not installed.
openshot-qt depends on python3-zmq; however:
Package python3-zmq is not installed.
>_
$ sudo apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu disco InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu disco-security InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu disco-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu disco-backports InRelease
Reading package lists... Done
>_
$ sudo apt-get upgrade unrar
APT
>_ /var/cache/apt/archives
$ sudo apt-get clean
/var/cache/apt/archives/partial
APT
>_
$ sudo apt-cache search p7zip
liblzma-dev - XZ-format compression library - development files
liblzma5 - XZ-format compression library
forensics-extra - Forensics Environment - extra console components
(metapackage)
p7zip - 7zr file archiver with high compression ratio
p7zip-full - 7z and 7za file archivers with high compression ratio
p7zip-rar - non-free rar module for p7zip
APT
>_
$ sudo apt-cache show liblzma5
# apt-cache show liblzma5
Package: liblzma5
Architecture: amd64
Version: 5.2.4-1
Multi-Arch: same
Priority: required
Section: libs
Source: xz-utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Jonathan Nieder <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 259
Depends: libc6 (>= 2.17)
Breaks: liblzma2 (<< 5.1.1alpha+20110809-3~)
Filename: pool/main/x/xz-utils/liblzma5_5.2.4-1_amd64.deb
Size: 92352
MD5sum: 223533a347dc76a8cc9445cfc6146ec3
SHA1: 8ed14092fb1caecfebc556fda0745e1e74ba5a67
SHA256: 01020b5a0515dbc9a7c00b464a65450f788b0258c3fbb733ecad0438f5124800
Homepage: https://tukaani.org/xz/
Description-en: XZ-format compression library
XZ is the successor to the Lempel-Ziv/Markov-chain Algorithm
compression format, which provides memory-hungry but powerful
compression (often better than bzip2) and fast, easy decompression.
.
The native format of liblzma is XZ; it also supports raw (headerless)
streams and the older LZMA format used by lzma. (For 7-Zip's related
format, use the p7zip package instead.)
APT
/etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu/ disco main restricted universe multiverse
>_ buster-backports.list
>_
$ sudo apt-get install apt-file
>_
$ sudo zypper refresh $ sudo zypper se -u httpd
$ sudo zypper se -i
>_
$ sudo zypper in unrar
zypper in unrar
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following NEW package is going to be installed:
unrar
1 new package to install.
Overall download size: 141.2 KiB. Already cached: 0 B. After the operation,
additional 301.6 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package unrar-5.7.5-lp151.1.1.x86_64
(1/1), 141.2 KiB (301.6 KiB unpacked)
Retrieving: unrar-5.7.5-lp151.1.1.x86_64.rpm .......................[done]
Checking for file conflicts: .......................................[done]
(1/1) Installing: unrar-5.7.5-lp151.1.1.x86_64 .....................[done]
>_
$ sudo zypper rm unrar
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following package is going to be REMOVED:
unrar
1 package to remove.
After the operation, 301.6 KiB will be freed.
Continue? [y/n/v/...? shows all options] (y): y
(1/1) Removing unrar-5.7.5-lp151.1.1.x86_64 ........................[done]
zypper
>_
$ sudo zypper rm libgimp-2_0-0
Loading repository data...
Warning: No repositories defined. Operating only with the installed resolvables.
Nothing can be installed.
Reading installed packages...
Resolving package dependencies...
The following 6 packages are going to be REMOVED:
gimp gimp-help gimp-lang gimp-plugins-python libgimp-2_0-0
libgimpui-2_0-0
6 packages to remove.
After the operation, 98.0 MiB will be freed.
Continue? [y/n/v/...? shows all options] (y):
zypper
>_
$ sudo zypper repos
Repository priorities are without effect. All enabled repositories share the same
priority.
# | Alias | Name | Enabled | GPG Check | Refresh
---+---------------------------+------------------------------------+---------+
-----------+--------
1 | openSUSE-Leap-15.1-1 | openSUSE-Leap-15.1-1 | No |
---- | ----
2 | repo-debug | Debug Repository | No |
---- | ----
3 | repo-debug-non-oss | Debug Repository (Non-OSS) | No |
---- | ----
4 | repo-debug-update | Update Repository (Debug) | No |
---- | ----
5 | repo-debug-update-non-oss | Update Repository (Debug, Non-OSS) | No |
---- | ----
6 | repo-non-oss | Non-OSS Repository | Yes | (r) Yes | Yes
7 | repo-oss | Main Repository | Yes | (r) Yes | Yes
8 | repo-source | Source Repository | No |
---- | ----
zypper
>_
$ sudo zypper modifyrepo -d repo-non-oss
Repository 'repo-non-oss' has been successfully disabled.
>_
$ sudo zypper addrepo http://packman.inode.at/suse/openSUSE-Leap_15.1/packman
Adding repository 'packman' ........................................[done]
Repository 'packman' successfully added
URI : http://packman.inode.at/suse/openSUSE_Leap_15.1/
Enabled : Yes
GPG Check : Yes
Autorefresh : No
Priority : 99 (default priority)
Repository priorities are without effect. All enabled repositories share the same
priority.
• Bare-metal hypervisor
• Type-2 hypervisor
Migrations
• Costs vary based on the amount of storage used and storage speed
>_ cloud-config
$ vi cloud-config #cloud-config
timezone: Africa/Dar_es_Salaam
hostname: test-system
# Update the system when it first boots up
apt_update: true
apt_upgrade: true
# Install the Nginx web server
packages:
- nginx
Login Methods
CTRL + ALT + F2
Terminal Emulators
Local GUI
Local text console
Remote GUI
VNC RDP
Remote text-mode login
SSH
Secure SHell
telnet
SSH login
>_
$ ip a Server
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 SSH daemon
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state
UP group default qlen 1000
link/ether 08:00:27:6b:d7:87 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.17/24 brd 192.168.0.255 scope global dynamic
noprefixroute enp0s3
valid_lft 1966sec preferred_lft 1966sec
inet6 fe80::a00:27ff:fe6b:d787/64 scope link noprefixroute
SSH client
Computer
MacOS & Linux
Windows
SSH
>_
$ ssh [email protected]
[email protected]'s password:
Activate the web console with: systemctl enable --now cockpit.socket
>_
$ history
1 history
2 ls
3 ls -la
4 test
5 clear
6 cd
7 pwd
8 clear
10 ls -la
11 clear
Bash History
>_
$ history | grep sudo
9 sudo systemctl reboot
14 sudo -i
>_
$ ls -la /home/aaron
drwx------. 14 aaron aaron 4096 Dec 5 13:52 .
>_
$ cat .bash_history
history
ls
ls -la
test
clear
cd
pwd
clear
ls -la
clear
UP DOWN ENTER
Working With Files
and Directories
Listing Files and Directories
>_
$ ls
Pictures Desktop
ls list
Documents Videos
Downloads Music
$ ls -a -a all
.
..
.ssh
.bash_logout
.bash_profile
.bashrc
Pictures
Desktop Documents Videos
Downloads Music
Listing Files and Directories
>_
$ ls –l /var/log/
total 4064
drwxr-xr-x. 2 root root 4096 Oct 18 22:52 anaconda
drwx------. 2 root root 23 Oct 18 22:53 audit
-rw-------. 1 root root 19524 Nov 1 17:56 boot.log
-rw-rw----. 1 root utmp 0 Nov 1 14:08 btmp
-rw-rw----. 1 root utmp 0 Oct 18 22:38 btmp-20211101
drwxr-x---. 2 chrony chrony 6 Jun 24 09:21 chrony
-rw-------. 1 root root 9794 Nov 1 18:01 cron
-rw-------. 1 root root 10682 Oct 26 14:01 cron-20211026
drwxr-xr-x. 2 lp sys 135 Oct 26 14:13 cups
-rw-r--r--. 1 root root 35681 Nov 1 18:13 dnf.rpm.log
-rw-r-----. 1 root root 4650 Nov 1 17:56 firewalld
drwx--x--x. 2 root gdm 6 Oct 19 00:07 gdm
drwxr-xr-x. 2 root root 6 Aug 31 12:07 glusterfs
Listing Files and Directories
>_
$ ls –a -l $ ls –al
total 76
drwx------. 16 aaron aaron 4096 Nov 1 17:57 .
drwxr-xr-x. 7 root root 70 Oct 26 16:54 ..
-rw-------. 1 aaron aaron 5085 Nov 1 17:56 .bash_history
-rw-r--r--. 1 aaron aaron 18 Jul 27 09:21 .bash_logout
-rw-r--r--. 1 aaron aaron 141 Jul 27 09:21 .bash_profile
-rw-r--r--. 1 aaron aaron 376 Jul 27 09:21 .bashrc
drwxr-xr-x. 2 aaron aaron 6 Oct 19 00:11 Desktop
drwxr-xr-x. 3 aaron aaron 25 Oct 23 18:15 Documents
drwxr-xr-x. 2 aaron aaron 6 Oct 19 00:11 Downloads
drwxr-xr-x. 2 aaron aaron 6 Oct 19 00:11 Music
drwxr-xr-x. 2 aaron aaron 28 Oct 26 13:37 Pictures
-rw-rw-r--. 1 aaron aaron 36 Oct 28 20:06 testfile
Listing Files and Directories
>_
$ ls –alh -h human readable format
total 76K
drwx------. 16 aaron aaron 4.0K Nov 1 17:57 .
drwxr-xr-x. 7 root root 70 Oct 26 16:54 ..
-rw-------. 1 aaron aaron 5.0K Nov 1 17:56 .bash_history
-rw-r--r--. 1 aaron aaron 18 Jul 27 09:21 .bash_logout
-rw-r--r--. 1 aaron aaron 141 Jul 27 09:21 .bash_profile
-rw-r--r--. 1 aaron aaron 376 Jul 27 09:21 .bashrc
drwxr-xr-x. 2 aaron aaron 6 Oct 19 00:11 Desktop
drwxr-xr-x. 3 aaron aaron 25 Oct 23 18:15 Documents
drwxr-xr-x. 2 aaron aaron 6 Oct 19 00:11 Downloads
drwxr-xr-x. 2 aaron aaron 6 Oct 19 00:11 Music
drwxr-xr-x. 2 aaron aaron 28 Oct 26 13:37 Pictures
-rw-rw-r--. 1 aaron aaron 36 Oct 28 20:06 testfile
Filesystem Tree
home var
Documents
Invoice.pdf
Filesystem Tree
home var
/ home/aaron/Documents/Invoice.pdf
/
home var
Documents
Invoice.pdf
Current / Working Directory
>_
/
$ pwd print working directory
/root
Documents
Invoice.pdf
Current / Working Directory
>_
$ cd /var/log change directory /
$ cd .. .. = parent directory
Documents
Invoice.pdf
Relative Path
>_
Invoice.pdf /
$ Documents/Invoice.pdf
$ Invoice.pdf
Invoice.pdf home var
$ ../Invoice.pdf
Documents
Invoice.pdf
Current / Working Directory
>_
/
$ cd / # Go to root directory
$ cd - # Go to previous directory
home var
$ cd # Go to home directory
aaron log
Documents
Invoice.pdf
Creating Files
>_
$ touch Receipt.pdf /
$ touch /home/jane/Receipt.pdf
aaron jane
Receipt.pdf Receipt.pdf
Creating Directories
>_
/
$ mkdir Receipts make directory
home
aaron jane
Receipts
Receipt.pdf Receipt.pdf
Copying Files
>_
# cp [source] [destination] /
copy
$ cp Receipt.pdf Receipts/
aaron
Receipts
Receipt.pdf
Receipt.pdf ReceiptCopy.pdf
Copying Directories
>_
# cp -r [source] [dest] /
recursive
$ cp –r Receipts/ BackupOfReceipts/
home
aaron
Receipts BackupOfReceipts
D D D D D D
F F F F F F
Copying Directories
>_
# cp -r [source] [dest] /
recursive
aaron
Receipts BackupOfReceipts
D D D
F F F Receipts
D D D
F F F
Moving Files
>_
/
$ cp Receipt.pdf Receipts/
home
aaron
2
Receipts
Receipt.pdf
Receipt.pdf 1
Moving Files
>_
/
# mv [source] [dest] move
$ mv Receipt.pdf Receipts/
home
$ mv Receipt.pdf OldReceipt.pdf
$ mv Receipts/ OldReceipts/
aaron
Receipts
OldReceipts
Receipt.pdf
1
OldReceipt.pdf
Deleting Files and Directories
>_
/
# rm remove
$ rm Invoice.pdf
$ rm -r Invoices/ home
aaron
Invoices
Invoice.pdf
Manage System-wide
Environment Profiles
Manage System-wide Environment Profiles
>_
$ printenv $ env
PATH=/home/aaron/.local/bin:/home/aaron/bin:/usr/local/bin:/usr/local/sbin
:/usr/bin:/usr/sbin
HISTSIZE=1000
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/2260,unix/unix:/tmp/.ICE-
unix/2260
$ HISTSIZE=2000
$ history
1 sudo nano -w /etc/hosts
2 ssh [email protected]
3 ssh student@LFCS-CentOS2
4 ls
5 ls -laF
6 cd .ssh
7 ls
8 nano -w known_hosts
9 exit
10 rm .ssh/known_hosts
Manage System-wide Environment Profiles
>_
$ printenv
PWD=/home/aaron
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/home/aaron
$ echo $HOME
/home/aaron
>_ environment
$ cat .bashrc
# .bashrc KODEKLOUD=https://kodekloud.com
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
$ logout
$ echo $KODEKLOUD
https://kodekloud.com
Manage System-wide Environment Profiles
>_ environment
$ sudo vim /etc/profile.d/lastlogin.sh echo "Your last login was at: " >
$HOME/lastlogin
$ ls
lastlogin
$ cat lastlogin
Your last login was at: Thursday DEC 16 11:19:27 CDT 2021
Manage Template
User Environment
Manage Template User Environment
>_ README
$ sudo vim /etc/skel/README Please don't run CPU-intensive
processes between 8AM and 10PM.
$ sudo ls -a /home/trinity
. .. .bash_logout .bash_profile .bashrc README
$ cat README
Please don't run CPU-intensive processes between 8AM and 10PM.
Manage Template User
Environment
>_ .bashrc
$ sudo vim /home/trinity/.bashrc
PATH="$HOME/.local/bin:$HOME/bi
n:$PATH"
$ echo $PATH
/home/trinity/.local/bin:/home/trinity/bin:/usr/local/bin:/usr/bin:/usr PATH="$HOME/.local/bin:$HOME/bin
/local/sbin:/usr/sbin :/opt/bin:$PATH"
$ specialtool $ /opt/specialtool
>_
$ find /home -name *.png
photo.png
cat.png
frank.png
$ ls lpic-*.txt
lpic-1.txt lpic-2.txt
$ cp -r animal/* forest
$ rm *ate*
Question Mark
>_
$ ls
last.txt lest.txt list.txt third.txt past.txt
$ ls l?st.txt
last.txt lest.txt list.txt
$ ls ??st.txt
last.txt lest.txt list.txt past.txt
Bracketed Characters
>_
$ ls l[aef]st.txt
last.txt lest.txt
$ ls l[a-z]st.txt
last.txt lest.txt list.txt
$ ls
student-1A.txt student-2A.txt student-3.txt
$ ls student-[0-9][A-Z].txt
student-1A.txt student-2A.txt
Combining Wildcards
>_
$ ls
last.txt lest.txt list.txt third.txt past.txt
$ ls [plf]?st*
last.txt lest.txt list.txt past.txt
$ ls
file1.txt file.txt file23.txt fom23.txt
$ ls f*[0-9].txt
file1.txt file23.txt fom23.txt
Analyze Text With
Regular Expressions .*
Regular Expressions
203.102.3.5
5.23
x is an integer
x is greater than 3 (x > 3)
x is less than 8 (x < 8)
x = 4, 5, or 6
Regex Operators
^
$
.
*
+
{}
?
|
[]
()
[^]
^ “The line begins with”
>_
$ less /etc/login.defs $ grep –v '^#' /etc/login.defs
# MAIL_DIR /var/spool/mail
# Please note that the parameters in this configuration file control the
# behavior of the tools from the shadow-utils component. None of these UMASK 022
# tools uses the PAM mechanism, and the utilities that use PAM (such as the
# passwd command) should therefore be configured elsewhere. Refer to HOME_MODE 0700
# /etc/pam.d/system-auth for more information.
# PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
# *REQUIRED* PASS_MIN_LEN 5
# Directory where mailboxes reside, _or_ name of file, relative to the PASS_WARN_AGE 7
# home directory. If you _do_ define both, MAIL_DIR takes precedence.
# QMAIL_DIR is for Qmail UID_MIN 1000
# UID_MAX 60000
#QMAIL_DIR Maildir SYS_UID_MIN 201
MAIL_DIR /var/spool/mail SYS_UID_MAX 999
#MAIL_FILE .mail
GID_MIN 1000
GID_MAX 60000
$ grep '^#' /etc/login.defs SYS_GID_MIN 201
SYS_GID_MAX 999
CREATE_HOME yes
^ “The line begins with”
>_
>_
^PASS
mail$
. “Match any ONE character”
>_
>_
$ grep –wr 'c.t' /etc/
/etc/brltty/Input/mn/all.txt:Left: append to existing cut buffer from selected character
/etc/brltty/Input/mn/all.txt:Up: start new cut buffer at selected character
/etc/brltty/Input/mn/all.txt:Down: rectangular cut to selected character
/etc/brltty/Input/mn/all.txt:Right: linear cut to selected character
grep: /etc/libvirt: Permission denied
grep: /etc/wpa_supplicant/wpa_supplicant.conf: Permission denied
/etc/mime.types:application/vnd.commonspace csp cst
/etc/mime.types:# wav: audio/x-wav, cpt: application/mac-compactpro
/etc/mime.types:application/mac-compactpro cpt
grep: /etc/sudo-ldap.conf: Permission denied
grep: /etc/sudo.conf: Permission denied
grep: /etc/sudoers: Permission denied
grep: /etc/sudoers.d: Permission denied
grep: /etc/iscsi/iscsid.conf: Permission denied
grep: /etc/firewalld: Permission denied
/etc/mcelog/triggers/cache-error-trigger: if [ "$(cat $F)" != "0" ] ; then
/etc/smartmontools/smartd_warning.sh: cat <<EOF
Special Characters
>_
$ grep '.' /etc/login.defs
SYS_UID_MIN 201
SYS_UID_MAX 999
#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN 1000
GID_MAX 60000
# System accounts
SYS_GID_MIN 201
SYS_GID_MAX 999
#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
#USERDEL_CMD /usr/sbin/userdel_local
#
# If useradd should create home directories for users by default
# On RH systems, we do. This option is overridden with the -m flag on
# useradd command line.
#
CREATE_HOME yes
# This enables userdel to remove user groups if no members exist.
\: Escaping For Special Characters
>_
$ grep '\.' /etc/login.defs
# behavior of the tools from the shadow-utils component. None of these
# passwd command) should therefore be configured elsewhere. Refer to
# /etc/pam.d/system-auth for more information.
# home directory. If you _do_ define both, MAIL_DIR takes precedence.
#MAIL_FILE .mail
# Default initial "umask" value used by login(1) on non-PAM enabled
systems.
# Default "umask" value for pam_umask(8) on PAM enabled systems.
# home directories if HOME_MODE is not set.
# for increased privacy. There is no One True Answer here: each sysadmin
# must make up their mind.
# home directories.
# If HOME_MODE is not set, the value of UMASK is used to create the mode.
# PASS_MAX_DAYS Maximum number of days a password may be
used.
# PASS_MIN_DAYS Minimum number of days allowed between
password changes.
# PASS_MIN_LEN Minimum acceptable password length.
# PASS_WARN_AGE Number of days warning given before a
password expires.
*: Match The Previous Element 0 Or More Times
>_
let* lettt
lett
let
$ grep -r 'let*' /etc/
/etc/pnm2ppa.conf:# configuration file (/etc/pnm2ppa.conf), and not from
configuration files
/etc/pnm2ppa.conf:#silent 1
/etc/pnm2ppa.conf:# (Older versions of pnm2ppa required larger left and
right margins to avoid
/etc/pnm2ppa.conf:# printer failure with "flashing lights", but this
problem is believed to
/etc/pnm2ppa.conf:#leftmargin 10
/etc/pnm2ppa.conf:# and color ink print cartridges. This changes a
little whenever you
/etc/pnm2ppa.conf:# if there is a horizontal offset between right-to-left
and left-to-right
/etc/pnm2ppa.conf:# density of black ink used: 1 (least ink), 2 (default),
4 (most).
/etc/pnm2ppa.conf:# a calibration file /etc/pnm2ppa.gamma, in which case
these
/etc/pnm2ppa.conf:# gEnh(i) = (int) ( pow ( (double) i / 256, Gamma ) *
256 )
/etc/pnm2ppa.conf:# Valid choices are: a4, letter, legal:
/etc/pnm2ppa.conf:#papersize letter # this is the default
/etc/pnm2ppa.conf:#papersize legal
*: Match The Previous Element 0 Or More Times
>_
$ grep -r '/.*/' /etc/ Begins with /; has 0 or more characters between; ends with a /
/etc/man_db.conf:# before /usr/man.
/etc/man_db.conf:MANDB_MAP /usr/man
/var/cache/man/fsstnd
/etc/man_db.conf:MANDB_MAP /usr/share/man
/var/cache/man
/etc/man_db.conf:MANDB_MAP /usr/local/man
/var/cache/man/oldlocal
/etc/man_db.conf:MANDB_MAP /usr/local/share/man
/var/cache/man/local
/etc/man_db.conf:MANDB_MAP /usr/X11R6/man
/var/cache/man/X11R6
/etc/man_db.conf:MANDB_MAP /opt/man /var/cache/man/opt
/etc/nanorc:# set quotestr "^([ ]*([#:>|}]|//))+"
/etc/nanorc:## include "/path/to/syntax_file.nanorc"
/etc/nanorc:include "/usr/share/nano/*.nanorc"
/etc/pbm2ppa.conf:# Sample configuration file for the HP720/HP820/HP1000
PPA Printers
/etc/pbm2ppa.conf:# /etc/pbm2ppa.conf
/etc/pnm2ppa.conf:# /etc/pnm2ppa.conf
/etc/pnm2ppa.conf:# configuration file (/etc/pnm2ppa.conf), and not from
configuration files
/etc/pnm2ppa.conf:# a calibration file /etc/pnm2ppa.gamma, in which case
these
/etc/mailcap:audio/*; /usr/bin/xdg-open %s
+: Match The Previous Element 1 Or More Times
>_
>_
>_
0+ 000
00
$ grep -r '0+' /etc/ $ man grep
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KP2 MENU_NEXT_ITEM In basic regular expressions the meta-characters
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KP7 MENU_FIRST_ITEM ?, +, {, |, (, and ) lose their special meaning;
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KP1 MENU_LAST_ITEM instead use the backslashed versions \?, \+, \{,
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KP9 MENU_PREV_SETTING \|, \(, and \).
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KP3 MENU_NEXT_SETTING
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KP5 MENU_PREV_LEVEL
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KPEnter PREFMENU
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KPPlus PREFSAVE
/etc/brltty/Keyboard/keypad.ktb:bind KP0+!KPMinus PREFLOAD
grep: /etc/libvirt: Permission denied
grep: /etc/wpa_supplicant/wpa_supplicant.conf: Permission denied
/etc/mime.types:application/vnd.d2l.coursepackage1p0+zip
grep: /etc/sudo-ldap.conf: Permission denied
grep: /etc/sudo.conf: Permission denied
grep: /etc/sudoers: Permission denied
grep: /etc/sudoers.d: Permission denied
grep: /etc/iscsi/iscsid.conf: Permission denied
/etc/sane.d/mustek_pp.conf:# - cis1200+ (for Mustek 1200CP+
& OEM versions),
/etc/sane.d/mustek_pp.conf:# scanner Mustek-1200CP+ 0x378 cis1200+
/etc/sane.d/mustek_pp.conf:# scanner mustek-cis1200+ * cis1200+
/etc/sane.d/teco1.conf:scsi "RELISYS" "VM3530+" Scanner * * * 0
+: Match The Previous Element 1 Or More Times
>_
>_
>_
>_
$ egrep -r '10{,3}' /etc/
/etc/pnm2ppa.conf:#xoffset 160
/etc/pnm2ppa.conf:# sweeps of the print head, adjust these in units of
1"/600 (1 dot).
/etc/pnm2ppa.conf:# valid blackness choices are 1 2 3 4; controls the
/etc/pnm2ppa.conf:# density of black ink used: 1 (least ink), 2 (default),
4 (most).
/etc/pnm2ppa.conf:# (i.e., 256 times ( i*(1.0/256)) to the power Gamma ),
/etc/pnm2ppa.conf:# the corresponding color. Gamma = 1.0 corresponds to
no
/etc/pnm2ppa.conf:#GammaR 1.0 # red enhancement
/etc/pnm2ppa.conf:#GammaG 1.0 # green enhancement
/etc/pnm2ppa.conf:#GammaB 1.0 # blue enhancement
/etc/pnm2ppa.conf:# which gives Gamma = 1.0 - 0.033 * GammaIdx :
/etc/pnm2ppa.conf:# (unimode 1) uncomment the next line . (The command
line options --uni
/etc/pnm2ppa.conf:#unimode 1
/etc/pnm2ppa.conf:#black_ink 1
/etc/pnm2ppa.conf:#color_ink 1
/etc/pnm2ppa.conf:#cyan_ink 1
/etc/pnm2ppa.conf:#magenta_ink 1
/etc/pnm2ppa.conf:#yellow_ink 1
/etc/subuid-:aaron:100000:65536
/etc/subuid-:bob:165536:65536
/etc/subuid-:charles:231072:65536
{}: Previous Element Can Exist “this many” Times
>_
$ egrep -r '0{3}' /etc/
/etc/vmware-tools/vgauth/schemas/xmldsig-core-schema.xsd: [2]
http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
/etc/vmware-tools/vgauth/schemas/xmldsig-core-schema.xsd:<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
targetNamespace="http://www.w3.org/2000/09/xmldsig#" version="0.1"
elementFormDefault="qualified">
grep: /etc/firewalld: Permission denied
/etc/smartmontools/smartd.conf:# Monitor 4 ATA disks connected to a 3ware
6/7/8000 controller which uses
/etc/smartmontools/smartd.conf:# Monitor 2 ATA disks connected to a 3ware
9000 controller which
/etc/smartmontools/smartd.conf:# Monitor 2 SATA (not SAS) disks connected
to a 3ware 9000 controller which
/etc/nanorc:## of tabs and spaces. 187 in ISO 8859-1 (0000BB in Unicode)
and 183 in
/etc/nanorc:## ISO-8859-1 (0000B7 in Unicode) seem to be good values for
these.
/etc/pbm2ppa.conf:# Sample configuration file for the HP720/HP820/HP1000
PPA Printers
/etc/pbm2ppa.conf:# 1000: HP DeskJet 1000Cse,
1000Cxi
/etc/pbm2ppa.conf:#version 1000
/etc/pnm2ppa.conf:#version 1000
/etc/subuid-:aaron:100000:65536
?: Make The Previous Element Optional
>_
$ egrep -r 'disabled?' /etc/
t to 0 to disable polling.
/etc/vmware-tools/tools.conf.example:# Set to true to disable the
deviceHelper plugin.
/etc/vmware-tools/tools.conf.example:#disabled=false
/etc/containers/storage.conf:# Value 0% disables
/etc/dleyna-server-service.conf:# 0 = disabled
/etc/dleyna-server-service.conf:# You can't enable levels disabled at
compile time
/etc/dleyna-server-service.conf:# If netf is enabled but the list is
empty, it behaves as disabled.
/etc/tuned/tuned-main.conf:# Dynamicaly tune devices, if disabled only
static tuning will be used.
/etc/tuned/tuned-main.conf:# Recommend functionality, if disabled
"recommend" command will be not
/etc/enscript.cfg:# Enable / disable page prefeed.
grep: /etc/firewalld: Permission denied
/etc/mcelog/mcelog.conf:# An upstream bug prevents this from being
disabled
/etc/smartmontools/smartd.conf:# -o VAL Enable/disable automatic
offline tests (on/off)
/etc/smartmontools/smartd.conf:# -S VAL Enable/disable attribute
autosave (on/off)
/etc/smartmontools/smartd_warning.sh:# Plugin directory (disabled if
empty)
{}: Previous Element Can Exist “this many” Times
>_
$ egrep -r '0{3,5}' /etc/ 0{min,max}
000/09/xmldsig#
/etc/vmware-tools/vgauth/schemas/xmldsig-core-schema.xsd: [2]
http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
/etc/vmware-tools/vgauth/schemas/xmldsig-core-schema.xsd:<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
targetNamespace="http://www.w3.org/2000/09/xmldsig#" version="0.1"
elementFormDefault="qualified">
grep: /etc/firewalld: Permission denied
/etc/smartmontools/smartd.conf:# Monitor 4 ATA disks connected to a 3ware
6/7/8000 controller which uses
/etc/smartmontools/smartd.conf:# Monitor 2 ATA disks connected to a 3ware
9000 controller which
/etc/smartmontools/smartd.conf:# Monitor 2 SATA (not SAS) disks connected
to a 3ware 9000 controller which
/etc/nanorc:## of tabs and spaces. 187 in ISO 8859-1 (0000BB in Unicode)
and 183 in
/etc/nanorc:## ISO-8859-1 (0000B7 in Unicode) seem to be good values for
these.
/etc/pbm2ppa.conf:# Sample configuration file for the HP720/HP820/HP1000
PPA Printers
/etc/pbm2ppa.conf:# 1000: HP DeskJet 1000Cse,
1000Cxi
|: Match One Thing Or The Other
>_
$ egrep -r 'enabled|disabled' /etc/
/etc/vmware-tools/tools.conf.example:# disabled.
/etc/vmware-tools/tools.conf.example:#disabled=false
/etc/dleyna-server-service.conf:# 0 = disabled
/etc/dleyna-server-service.conf:# You can't enable levels disabled at
compile time
/etc/dleyna-server-service.conf:netf-enabled=false
/etc/dleyna-server-service.conf:# If netf is enabled but the list is
empty, it behaves as disabled.
/etc/tuned/tuned-main.conf:# Dynamicaly tune devices, if disabled only
static tuning will be used.
/etc/tuned/tuned-main.conf:# Recommend functionality, if disabled
"recommend" command will be not
/etc/tuned/tuned-main.conf:# /etc/sysctl.conf. If enabled, these sysctls
will be re-appliead
grep: /etc/firewalld: Permission denied
/etc/mcelog/mcelog.conf:# An upstream bug prevents this from being
disabled
/etc/mcelog/mcelog.conf:dimm-tracking-enabled = yes
/etc/mcelog/mcelog.conf:socket-tracing-enabled = yes
/etc/smartmontools/smartd_warning.sh:# Plugin directory (disabled if
empty)
/etc/nanorc:## To make sure an option is disabled, use "unset <option>".
|: Match One Thing Or The Other
>_
$ egrep -ir 'enabled?|disabled?' /etc/
grep: /etc/firewalld: Permission denied
/etc/mcelog/mcelog.conf:# An upstream bug prevents this from being
disabled
/etc/mcelog/mcelog.conf:# Enable DIMM-tracking
/etc/mcelog/mcelog.conf:dimm-tracking-enabled = yes
/etc/mcelog/mcelog.conf:# Disable DIMM DMI pre-population unless supported
on your system
/etc/mcelog/mcelog.conf:socket-tracing-enabled = yes
/etc/smartmontools/smartd.conf:# First ATA/SATA or SCSI/SAS disk. Monitor
all attributes, enable
/etc/smartmontools/smartd.conf:# -o VAL Enable/disable automatic
offline tests (on/off)
/etc/smartmontools/smartd.conf:# -S VAL Enable/disable attribute
autosave (on/off)
/etc/smartmontools/smartd_warning.sh:# Plugin directory (disabled if
empty)
/etc/nanorc:## Please note that you must have configured nano with --
enable-nanorc
/etc/nanorc:## To make sure an option is disabled, use "unset <option>".
/etc/nanorc:## When soft line wrapping is enabled, make it wrap lines at
blanks
/etc/nanorc:## Enable vim-style lock-files. This is just to let a vim
user know you
[]: Ranges Or Sets
>_
$ egrep -r 'c[au]t' /etc/ [a-z] [0-9] [abz954]
/etc/man_db.conf:# Range of terminal widths permitted when displaying cat
pages. If the
/etc/man_db.conf:# terminal falls outside this range, cat pages will not
be created (if
/etc/man_db.conf:# If CATWIDTH is set to a non-zero number, cat pages will
always be
/etc/man_db.conf:# NOCACHE keeps man from creating cat pages.
/etc/nanorc:## Use cut-from-cursor-to-end-of-line by default.
/etc/nanorc:# set cutfromcursor
/etc/nanorc:## (The old form, 'cut', is deprecated.)
/etc/nanorc:## double click), and execute shortcuts. The mouse will work
in the X
/etc/nanorc:## Don't display the helpful shortcut lists at the bottom of
the screen.
/etc/nanorc:## (The old form, 'justifytrim', is deprecated.)
/etc/nanorc:## Disallow file modification. Why would you want this in an
rcfile? ;)
/etc/nanorc:# bind M-B cutwordleft main
/etc/nanorc:# bind M-N cutwordright main
/etc/mailcap:application/msword; /usr/bin/xdg-open %s
/etc/mailcap:application/pdf; /usr/bin/xdg-open %s
/etc/mailcap:application/postscript ; /usr/bin/xdg-open %s
[]: Ranges Or Sets
>_
$ egrep -r '/dev/.*' /etc/
/etc/smartmontools/smartd.conf:#/dev/twa0 -d 3ware,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:# On FreeBSD /dev/tws0 should be used
instead
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:#/dev/hdc,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/hdc,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/1 -a -s L/../../7/01
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/2 -a -s L/../../7/02
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/3 -a -s L/../../7/03
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/4/1 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/4/2 -a -s L/../../2/03
/etc/smartmontools/smartd_warning.sh: hostname=`eval $cmd 2>/dev/null` ||
continue
/etc/smartmontools/smartd_warning.sh: dnsdomain=`eval $cmd 2>/dev/null`
|| continue
/etc/smartmontools/smartd_warning.sh: nisdomain=`eval $cmd 2>/dev/null`
|| continue
/etc/smartmontools/smartd_warning.sh: echo "$cmd </dev/null"
/etc/smartmontools/smartd_warning.sh: "$cmd" </dev/null
/etc/smartmontools/smartd_warning.sh: echo "$cmd </dev/null"
/etc/smartmontools/smartd_warning.sh: "$cmd" </dev/null
/etc/smartmontools/smartd_warning.sh: echo "exec '$SMARTD_MAILER'
</dev/null"
[]: Ranges Or Sets
>_
$ egrep -r '/dev/[a-z]*' /etc/
/etc/smartmontools/smartd.conf:#/dev/twa0 -d 3ware,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:# On FreeBSD /dev/tws0 should be used instead
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:#/dev/hdc,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/hdc,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/1 -a -s L/../../7/01
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/2 -a -s L/../../7/02
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/3 -a -s L/../../7/03
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/4/1 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/4/2 -a -s L/../../2/03
/etc/smartmontools/smartd_warning.sh: hostname=`eval $cmd 2>/dev/null` || continue
/etc/smartmontools/smartd_warning.sh: dnsdomain=`eval $cmd 2>/dev/null` || continue
/etc/smartmontools/smartd_warning.sh: nisdomain=`eval $cmd 2>/dev/null` || continue
/etc/smartmontools/smartd_warning.sh: echo "$cmd </dev/null"
/etc/smartmontools/smartd_warning.sh: "$cmd" </dev/null
/etc/smartmontools/smartd_warning.sh: echo "$cmd </dev/null"
/etc/smartmontools/smartd_warning.sh: "$cmd" </dev/null
/etc/smartmontools/smartd_warning.sh: echo "exec '$SMARTD_MAILER' </dev/null"
[]: Ranges Or Sets
>_
$ egrep -r '/dev/[a-z]*[0-9]' /etc/
/etc/sane.d/umax_pp.conf:# /dev/ppi1, ...
/etc/sane.d/fujitsu.conf:#scsi /dev/sg1
/etc/sane.d/v4l.conf:/dev/bttv0
/etc/sane.d/v4l.conf:/dev/video0
/etc/sane.d/v4l.conf:/dev/video1
/etc/sane.d/v4l.conf:/dev/video2
/etc/sane.d/v4l.conf:/dev/video3
/etc/sane.d/gphoto2.conf:port=serial:/dev/ttyd1
/etc/sane.d/kodak.conf:#scsi /dev/sg1
/etc/sane.d/ma1509.conf:#/dev/uscanner0
/etc/sane.d/mustek_usb.conf:#/dev/usbscanner0
/etc/sane.d/snapscan.conf:# For SCSI scanners specify the generic device, e.g. /dev/sg0 on Linux.
/etc/sane.d/snapscan.conf:# /dev/sg0
grep: /etc/firewalld: Permission denied
/etc/smartmontools/smartd.conf:# For example /dev/twe0, /dev/twe1, and so on.
/etc/smartmontools/smartd.conf:#/dev/twa0 -d 3ware,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/twa0 -d 3ware,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:# On FreeBSD /dev/tws0 should be used instead
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,1 -a -s L/../../2/03
[]: Ranges Or Sets
>_
$ egrep -r '/dev/[a-z]*[0-9]?' /etc/
/etc/smartmontools/smartd.conf:#/dev/twa0 -d 3ware,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:# On FreeBSD /dev/tws0 should be used instead
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/twl0 -d 3ware,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:#/dev/hdc,0 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/hdc,1 -a -s L/../../2/03
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/1 -a -s L/../../7/01
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/2 -a -s L/../../7/02
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/3 -a -s L/../../7/03
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/4/1 -a -s L/../../2/01
/etc/smartmontools/smartd.conf:#/dev/sdd -d hpt,1/4/2 -a -s L/../../2/03
/etc/smartmontools/smartd_warning.sh: hostname=`eval $cmd 2>/dev/null` || continue
/etc/smartmontools/smartd_warning.sh: dnsdomain=`eval $cmd 2>/dev/null` || continue
/etc/smartmontools/smartd_warning.sh: nisdomain=`eval $cmd 2>/dev/null` || continue
/etc/smartmontools/smartd_warning.sh: echo "$cmd </dev/null"
/etc/smartmontools/smartd_warning.sh: "$cmd" </dev/null
/etc/smartmontools/smartd_warning.sh: echo "$cmd </dev/null"
/etc/smartmontools/smartd_warning.sh: "$cmd" </dev/null
/etc/smartmontools/smartd_warning.sh: echo "exec '$SMARTD_MAILER' </dev/null"
(): Subexpressions
>_
$ egrep -r '/dev/[a-z]*[0-9]?' /etc/
/etc/sane.d/dc25.conf:#port=/dev/tty0p0
/etc/sane.d/dc25.conf:#port=/dev/tty01
/etc/sane.d/u12.conf:# device /dev/usbscanner
/etc/sane.d/u12.conf:# device /dev/usbscanner
1+2*3
/etc/sane.d/dmc.conf:/dev/camera
/etc/sane.d/umax.conf:/dev/scanner
/etc/sane.d/umax.conf:/dev/usbscanner
1+6 = 7
/etc/sane.d/epjitsu.conf:#usb /dev/usb/scanner0
/etc/sane.d/epjitsu.conf:#
'\.nal$' - 2>/dev/null; then
if echo "$nal" | grep -q
(1+2)*3
/etc/sane.d/epson.conf:#usb /dev/usbscanner0
/etc/sane.d/epson.conf:#usb /dev/usb/scanner0
/etc/sane.d/umax1220u.conf:#/dev/scanner
3*3 = 9
/etc/sane.d/umax1220u.conf:#/dev/usb/scanner0
/etc/sane.d/umax_pp.conf:# device : /dev/parport0, /dev/parport1, ......
/etc/sane.d/umax_pp.conf:# on *BSD, you may provide the device name of the
ppi device: /dev/ppi0,
/etc/sane.d/umax_pp.conf:# /dev/ppi1, ...
/etc/sane.d/fujitsu.conf:#scsi /dev/sg1
/etc/sane.d/fujitsu.conf:#usb /dev/usb/scanner0
/etc/sane.d/v4l.conf:/dev/bttv0
/etc/sane.d/v4l.conf:/dev/video0
/etc/sane.d/v4l.conf:/dev/video1
/etc/sane.d/v4l.conf:/dev/video2
(): Subexpressions
>_
$ egrep -r '/dev/([a-z]*[0-9]?)*' /etc/
/etc/sane.d/coolscan3.conf:#scsi:/dev/scanner
/etc/sane.d/coolscan3.conf:#usb:/dev/usbscanner
/etc/sane.d/dc210.conf:port=/dev/ttyS0
/etc/sane.d/dc210.conf:#port=/dev/ttyd1
/etc/sane.d/dc210.conf:#port=/dev/term/a [a-z]*[0-9]?
/etc/sane.d/dc210.conf:#port=/dev/tty0p0
/etc/sane.d/dc210.conf:#port=/dev/tty01 tty0p0
/etc/sane.d/dc240.conf:port=/dev/ttyS0
/etc/sane.d/dc240.conf:#port=/dev/ttyd1
/etc/sane.d/dc240.conf:#port=/dev/term/a
/etc/sane.d/dc240.conf:#port=/dev/tty0p0
/etc/sane.d/dc240.conf:#port=/dev/tty01
/etc/sane.d/dc25.conf:port=/dev/ttyS0
/etc/sane.d/dc25.conf:#port=/dev/ttyd1
/etc/sane.d/dc25.conf:#port=/dev/term/a
/etc/sane.d/dc25.conf:#port=/dev/tty0p0
/etc/sane.d/dc25.conf:#port=/dev/tty01
/etc/sane.d/u12.conf:# device /dev/usbscanner
/etc/sane.d/u12.conf:# device /dev/usbscanner
/etc/sane.d/dmc.conf:/dev/camera
/etc/sane.d/umax.conf:/dev/scanner
/etc/sane.d/umax.conf:/dev/usbscanner
(): Subexpressions
>_
$ egrep -r egrep -r '/dev/(([a-z]|[A-Z])*[0-9]?)*' /etc/
/etc/sane.d/coolscan3.conf:#scsi:/dev/scanner
/etc/sane.d/coolscan3.conf:#usb:/dev/usbscanner
/etc/sane.d/dc210.conf:port=/dev/ttyS0
/etc/sane.d/dc210.conf:#port=/dev/ttyd1
/etc/sane.d/dc210.conf:#port=/dev/term/a
/etc/sane.d/dc210.conf:#port=/dev/tty0p0
/etc/sane.d/dc210.conf:#port=/dev/tty01
/etc/sane.d/dc240.conf:port=/dev/ttyS0
([a-z]|[A-Z]*[0-9]?)*
/etc/sane.d/dc240.conf:#port=/dev/ttyd1
/etc/sane.d/dc240.conf:#port=/dev/term/a
/etc/sane.d/dc240.conf:#port=/dev/tty0p0
/etc/sane.d/dc240.conf:#port=/dev/tty01
/etc/sane.d/dc25.conf:port=/dev/ttyS0
/etc/sane.d/dc25.conf:#port=/dev/ttyd1
/etc/sane.d/dc25.conf:#port=/dev/term/a
/etc/sane.d/dc25.conf:#port=/dev/tty0p0
/etc/sane.d/dc25.conf:#port=/dev/tty01
/etc/sane.d/u12.conf:# device /dev/usbscanner
/etc/sane.d/u12.conf:# device /dev/usbscanner
/etc/sane.d/dmc.conf:/dev/camera
/etc/sane.d/umax.conf:/dev/scanner
/etc/sane.d/umax.conf:/dev/usbscanner
[^]: Negated Ranges Or Sets
>_
$ egrep –r 'http[^s]' /etc/
/etc/containers/registries.conf.d/001-rhel-
shortnames.conf:"openshift4/ose-egress-http-proxy" =
"registry.redhat.io/openshift4/ose-egress-http-proxy"
/etc/containers/registries.conf.d/001-rhel-shortnames.conf:"rhel8/httpd-
24" = "registry.redhat.io/rhel8/httpd-24"
/etc/containers/registries.conf.d/001-rhel-shortnames.conf:"rhscl/httpd-
24-rhel7" = "registry.access.redhat.com/rhscl/httpd-24-rhel7" [abc123]
/etc/containers/registries.conf.d/001-rhel-shortnames.conf:"ubi8/httpd-24"
= "registry.redhat.io/ubi8/httpd-24" [a-z]
/etc/containers/registries.d/default.yaml:# For reading signatures, schema
may be http, https, or file.
/etc/containers/registries.d/default.yaml:#
http://privateregistry.com/sigstore/
sigstore: http[^s] http https
/etc/wgetrc:# You can set the default proxies for Wget to use for http,
https, and ftp.
/etc/wgetrc:#https_proxy = http://proxy.yoyodyne.com:18023/
/etc/wgetrc:#http_proxy = http://proxy.yoyodyne.com:18023/
/etc/wgetrc:#ftp_proxy = http://proxy.yoyodyne.com:18023/
/etc/enscript.cfg:# along with Enscript. If not, see
<http://www.gnu.org/licenses/>.
grep: /etc/firewalld: Permission denied
/etc/smartmontools/smartd.conf:# Home page is:
http://www.smartmontools.org
[^]: Negated Ranges Or Sets
>_
$ egrep –r '/[^a-z]' /etc/ https://regexr.com
/etc/smartmontools/smartd_warning.sh: cmd="$plugindir/${ad#@}"
/etc/qemu-ga/fsfreeze-hook:for file in "$FSFREEZE_D"/* ; do
/etc/man_db.conf:MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
/etc/man_db.conf:MANPATH_MAP /usr/bin/X11 /usr/X11R6/man
/etc/man_db.conf:MANDB_MAP /usr/X11R6/man /var/cache/man/X11R6
/etc/nanorc:## Each user can save his own configuration to ~/.nanorc
/etc/nanorc:## Don't convert files from DOS/Mac format.
/etc/nanorc:# set quotestr "^([ ]*([#:>|}]|//))+"
/etc/nanorc:## Fix Backspace/Delete confusion problem.
/etc/nanorc:include "/usr/share/nano/*.nanorc"
/etc/pbm2ppa.conf:# Sample configuration file for the HP720/HP820/HP1000 PPA Printers
/etc/pbm2ppa.conf:# 1/4 inch margins all around (at 600 DPI)
/etc/pbm2ppa.conf:# 1/4 inch margins all around (at 600 DPI)
/etc/pbm2ppa.conf:# 1/4 inch margins all around (at 600 DPI)
/etc/pnm2ppa.conf:# paper. Units are dots (1/600 inch). Add a positive number of dots to
/etc/pnm2ppa.conf:# sweeps of the print head, adjust these in units of 1"/600 (1 dot).
/etc/pnm2ppa.conf:# gEnh(i) = (int) ( pow ( (double) i / 256, Gamma ) * 256 )
Compress and Decompress Files
Compression And Decompression Utilities
>_
$ gzip file1 $ gunzip file1.gz gzip --decompress file1.gz
file1.gz file1
5 MB
50 MB file1
file1.gz
5 MB
50 MB file1
file1.gz
Compression And Decompression Utilities
>_
$ gzip --help $ gzip --keep file1
Usage: gzip [OPTION]... [FILE]...
file1 file1.gz
Compress or uncompress FILEs (by default, compress FILES in-place).
Mandatory arguments to long options are mandatory for short options too.
$ bzip2 --keep file2
-c, --stdout write on standard output, keep original files unchanged file2 file2.bz2
-d, --decompress decompress
-f, --force force overwrite of output file and compress links
-h, --help give this help
-k, --keep keep (don't delete) input files $ xz --keep file3
-l, --list list compressed file contents
-L, --license display software license file3 file3.xz
-n, --no-name do not save or restore the original name and timestamp
-N, --name save or restore the original name and timestamp
-q, --quiet suppress all warnings
-r, --recursive operate recursively on directories $ gzip --list file1
--rsyncable make rsync-friendly archive compressed uncompressed ratio name
-S, --suffix=SUF use suffix SUF on compressed files 71 78 39.7% file1
--synchronous synchronous output
-t, --test test compressed file integrity
-v, --verbose verbose mode
-V, --version display version number
Compression And Decompression Utilities
>_
$ unzip archive.zip
Archive: archive.zip
replace file1? [y]es, [n]o, [A]ll, [N]one, [r]ename: N
Compression And Decompression With tar
>_
$ tar --create --file archive.tar file1
$ gzip archive.tar
archive.tar.gz
$ tar --create –-gzip --file archive.tar.gz file1 $ tar czf archive.tar.gz file1
$ tar --create –-bzip2 --file archive.tar.bz2 file1 $ tar cjf archive.tar.bz2 file1
$ tar --create –-xz --file archive.tar.xz file1 $ tar cJf archive.tar.xz file1
$ tar --create –-autocompress --file archive.tar.gz file1
$ tar caf archive.xz file1
$ tar --extract --file archive.tar.gz
$ tar xf archive.tar.gz file1
Backup to a Remote System
Syncing Two Directories
>_
rsync = remote synchronization
$ rsync –a Pictures/ [email protected]:/home/aaron/Pictures/
Remote Server
/home/aaron/Pictures
SSH daemon
Local Server
Pictures/
Disk Imaging
>_
>_
$ cat file.txt
6
5
1
3
4
2
$ sort file.txt
1
2
3
4
5
6
>_
$ date
Mon Nov 8 18:50:25 CST 2021
$ cat file.txt
Mon Nov 8 18:50:30 CST 2021
Redirecting Output
>_
$ cat file.txt
Mon Nov 8 18:50:30 CST 2021
Mon Nov 8 18:50:31 CST 2021
Mon Nov 8 18:50:32 CST 2021
Mon Nov 8 18:50:33 CST 2021
Mon Nov 8 18:50:34 CST 2021
Mon Nov 8 18:50:35 CST 2021
Redirecting Output
>_
stdin
< terminal
standard input
file.txt sort
errors.txt
>_
$ grep –r '^The' /etc/ $ grep –r '^The' /etc/ 2>/dev/null
grep: /etc/cups/ssl: Permission denied /etc/brltty/Input/tn/all.txt:The two keys at the left
grep: /etc/cups/subscriptions.conf.O: Permission denied rear (2 columns, 1 row):
grep: /etc/cups/subscriptions.conf: Permission denied /etc/brltty/Input/tn/all.txt:The four keys at the left
grep: /etc/ssh/sshd_config: Permission denied middle (cross):
grep: /etc/chrony.keys: Permission denied /etc/brltty/Input/tn/all.txt:The six keys at the left
grep: /etc/brlapi.key: Permission denied front (2 columns, 3 row):
/etc/brltty/Input/tn/all.txt:The two keys at the left /etc/brltty/Input/tn/all.txt:The one key at the right
rear (2 columns, 1 row): rear (1 column, 1 row):
/etc/brltty/Input/tn/all.txt:The four keys at the left /etc/brltty/Input/tn/all.txt:The two keys at the right
middle (cross): rear (1 column, 2 rows):
/etc/brltty/Input/tn/all.txt:The six keys at the left /etc/brltty/Input/tn/all.txt:The four keys at the right
front (2 columns, 3 row): rear (1 column, 4 rows):
/etc/brltty/Input/tn/all.txt:The one key at the right /etc/brltty/Input/tn/all.txt:The twelve keys of the
rear (1 column, 1 row): numeric pad (3 columns, 4 rows):
/etc/brltty/Input/tn/all.txt:The two keys at the right
rear (1 column, 2 rows):
/etc/brltty/Input/tn/all.txt:The four keys at the right
rear (1 column, 4 rows):
/etc/brltty/Input/tn/all.txt:The twelve keys of the
numeric pad (3 columns, 4 rows):
grep: /etc/libvirt: Permission denied
grep: /etc/wpa_supplicant/wpa_supplicant.conf:
Permission denied
grep: /etc/sudo-ldap.conf: Permission denied
Redirecting Output
>_
$ grep –r '^The' /etc/ 1>output.txt 2>errors.txt overwrite
>_
$ grep –r '^The' /etc/ $ grep –r '^The' /etc/ > all_output.txt 2>&1
grep: /etc/cups/ssl: Permission denied
grep: /etc/cups/subscriptions.conf.O: Permission denied
grep: /etc/cups/subscriptions.conf: Permission denied
$ grep –r '^The' /etc/ 1>all_output.txt 2>&1
grep: /etc/ssh/sshd_config: Permission denied
grep: /etc/chrony.keys: Permission denied $ grep –r '^The' /etc/ 2>&1 1>all_output.txt
grep: /etc/brlapi.key: Permission denied
/etc/brltty/Input/tn/all.txt:The two keys at the left grep: /etc/cups/classes.conf: Permission denied
rear (2 columns, 1 row): grep: /etc/cups/cups-files.conf: Permission denied
/etc/brltty/Input/tn/all.txt:The four keys at the left grep: /etc/cups/cups-files.conf.default: Permission denied
middle (cross): grep: /etc/cups/cupsd.conf: Permission denied
/etc/brltty/Input/tn/all.txt:The six keys at the left grep: /etc/cups/cupsd.conf.default: Permission denied
front (2 columns, 3 row): grep: /etc/cups/printers.conf: Permission denied
/etc/brltty/Input/tn/all.txt:The one key at the right grep: /etc/cups/snmp.conf.default: Permission denied
rear (1 column, 1 row): grep: /etc/cups/ssl: Permission denied
/etc/brltty/Input/tn/all.txt:The two keys at the right grep: /etc/cups/subscriptions.conf.O: Permission denied
rear (1 column, 2 rows): grep: /etc/cups/subscriptions.conf: Permission denied
/etc/brltty/Input/tn/all.txt:The four keys at the right grep: /etc/ssh/sshd_config: Permission denied
rear (1 column, 4 rows): grep: /etc/ssh/ssh_host_ecdsa_key: Permission denied
/etc/brltty/Input/tn/all.txt:The twelve keys of the grep: /etc/ssh/ssh_host_ed25519_key: Permission denied
numeric pad (3 columns, 4 rows): grep: /etc/ssh/ssh_host_rsa_key: Permission denied
grep: /etc/libvirt: Permission denied grep: /etc/nftables: Permission denied
grep: /etc/wpa_supplicant/wpa_supplicant.conf: grep: /etc/audit: Permission denied
Permission denied grep: /etc/gssproxy/99-nfs-client.conf: Permission denied
grep: /etc/sudo-ldap.conf: Permission denied
Redirecting Input
>_
$ sort file.txt from file
Bye
>_
>_
ENCRYPT_METHOD SHA512
Piping
>_
>_
cpio Copy In, Copy Out
$ ls | cpio -o > archive.cpio
.cpio or .tar files
$ cpio -id < archive.cpio Copying files to
archives
Extracting files from
archives
Command Substitution
Command Substitution
>_
Command Substitution
$ mkdir `date +%Y+%m+%d` Using the output of one command
as an argument to another
$ ls command.
2022-12-13
Backquotes: `` Normally located
on the same key as ~ on English
$ rmdir 2022-12-13 keyboards
$ ls
2022-12-13
$ OS=`uname -o`
$ echo $OS
GNU/Linux
Command Substitution
>_
$ find /usr/share/icons -name 'debian*' | xargs identify -format "%f: %wx%h\n"
debian-swirl.svg: 48x48
debian-swirl.png: 22x22
debian-swirl.png: 32x32
debian-swirl.png: 256x256
debian-swirl.png: 48x48
debian-swirl.png: 16x16
debian-swirl.png: 24x24
debian-swirl.svg: 48x48
>_
$ find . -name '*avi' -print0 -name '*mp4' -print0 -name '*mkv' -print0 | xargs -0 du | sort -n
$ find . -mindepth 2 -name '*avi' -print0 -o -name '*mp4' -print0 -o -name '*mkv' -print0 | xargs -0 -I PATH mv PATH ./
Using GNU Screen
Terminal Multiplexers
Windows can be split into regions or panes. Increases productivity when using
programs simultaneously.
Highly customizable.
GNU Screen: Windows
CTRL + a - w
0*$ bash
GNU Screen: Windows
>_ CTRL + a - c
$ ps
PID TTY TIME CMD
974 pts/2 00:00:00 bash
981 pts/2 00:00:00 ps
CTRL + a - w
CTRL + a - A
Set window's title to: ps
GNU Screen: Windows
>_ CTRL + a - n
$ screen -t yetanotherwindow
CTRL + a - p
CTRL + a - Number
UP DOWN ENTER
GNU Screen: Windows
>_ CTRL + a - k
Really kill this window [y/n]
Window 0 (bash) killed.
GNU Screen: Regions
>_ CTRL + a - S
1 ps --
CTRL + a - |
CTRL + a - TAB
$ ps $
PID TTY TIME CMD CTRL + a - 2
1020 pts/2 00:00:00 bash
1033 pts/2 00:00:00 ps
$ screen -t yetanotherwindow
1 ps 2
yetanotherwindow
GNU Screen: Regions
>_
$ screen -ls
There is a screen on:
1037.pts-0.debian (08/24/19 13:53:35)
(Attached)
1 Socket in /run/screen/S-carol.
$ screen -ls
There are screens on:
1090.second session (08/24/19 14:38:35)
(Attached)
1037.pts-0.debian (08/24/19 13:53:36)
(Attached)
2 Sockets in /run/screen/S-carol.
GNU Screen: Sessions
>_
$ screen -S 1037 -X quit
$ screen -ls
There is a screen on:
1090.second session (08/24/19 14:38:35)
(Detached)
1 Socket in /run/screen/S-carol.
GNU Screen: Session Detachment
>_ CTRL + a - d
[detached from 1090.second session]
$ screen -r
$ screen -ls
There is a screen on:
1090.second session (08/24/19 14:38:35)
(Attached)
1 Socket in /run/screen/S-carol.
GNU Screen: Reattaching
>_
$ screen -d -r Reattach. Detach first, if necessary
Paste: CTRL + a - ]
GNU Screen: Customization
>_ /etc/screenrc
$ sudo vi /etc/screnrc SCREEN SETTINGS
TERMINAL SETTINGS
STARTUP SCREENS
Using tmux
tmux
Released in 2007.
>_
$ tmux
[0] 0:bash* "debian" 18:53
27-Aug-19
>_
CTRL + b - c
[LPI] 0:Window zero- 1:bash* "debian" 19:02
27-Aug-19
CTRL + b - n
CTRL + b - p
tmux: Windows
>_
CTRL + b - NUMBER
CTRL + b - f
CTRL + b - .
$ man tmux
tmux: Panes
>_
CTRL + b - "
Tasks: 93 total, 1 running, 92 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 4050960 total, 3730920 free, 114880 used, 205160 buff/cache
KiB Swap: 4192252 total, 4192252 free, 0 used. 3716004 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1340 carol 20 0 44876 3400 2800 R 0.3 0.1 0:00.24 top
1 root 20 0 139088 6988 5264 S 0.0 0.2 0:00.50 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.04 ksoftirqd/0
4 root 20 0 0 0 0 S 0.0 0.0 0:01.62 kworker/0:0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
7 root 20 0 0 0 0 S 0.0 0.0 0:00.06 rcu_sched
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
11 root rt 0 0 0 0 S 0.0 0.0 0:00.01 watchdog/0
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
$
────────────────────────────────────────────────────────────────────────────
───────
────────────
$
[LPI] 0:Window zero- 1:Window one* "debian"
19:05 27-Aug-19
tmux: panes
>_
CTRL + b - %
│$
1 root 20 0 139088 6988 5264 S 0.0 0.2 0:00.50 systemd │
│
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd │
│
3 root 20 0 0 0 0 S 0.0 0.0 0:00.04 ksoftirqd/0 │
4 root 20 0 0 0 0 S 0.0 0.0 0:01.62 kworker/0:0 │
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H │
7 root 20 0 0 0 0 S 0.0 0.0 0:00.06 rcu_sched │
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh │
9 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 │
│
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drai │
n │
11 root rt 0 0 0 0 S 0.0 0.0 0:00.01 watchdog/0 │
│
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0 │
│
$ │
────────────────────────────────────────────────────────────────────────────
───┴───
────────────
$
[LPI] 0:Window zero- 1:Window one* "debian"
19:05 27-Aug-19
tmux: Panes
>_
CTRL + b - x
kill-pane 1? (y/n)
tmux: Panes
>_
CTRL + b - s
(0) + LPI: 2 windows (attached)
$ tmux ls
LPI: 2 windows (created Tue Aug 27 19:01:49 2019) [158x39] (attached)
>_
CTRL + b - $ ENTER
(rename-session) Second Session
UP/DOWN ENTER
$
tmux: Detachment
>_
$ tmux ls
LPI: 2 windows (created Tue Aug 27 19:01:49 2019) [158x39]
$ tmux a
CTRL + b - d
[exited]
CTRL + b - D
CTRL + b - r
tmux: Scrollback Mode
Paste: ALT + W
tmux: Customization
>_ /etc/tmux.conf
$ sudo vi /etc/tmux.conf # Change the prefix key to C-a
set -g prefix C-a
unbind C-b
$ vi ~/.tmux.conf bind C-a send-prefix
/ interactive search-and-replace
CTRL
GNU
NANO
META
/ VI
Nano
Paste: CTRL + U
Nano
Undo: META + U
Redo: META + E
Spell-check: CTRL + T
Emacs
>_ ~/.bash_profile
$ export EDITOR=nano EDITOR=nano
$ vi ~/.bash_profile
Demo
List, Create, Delete,
and Modify Physical Storage Partitions
Physical Storage Partitions
>_
block devices
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda
vda 8:0 0 20G 0 disk vda1
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
vda2
├─cs-root 253:0 0 17G 0 lvm / vdb
└─cs-swap 253:1 0 2G 0 lvm [SWAP] vdb1
vdb2
vdb3
vdc
vdc1
Physical Storage Partitions
>_
/dev/
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT /dev/vda1
vda 8:0 0 20G 0 disk
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
├─cs-root 253:0 0 17G 0 lvm /
└─cs-swap 253:1 0 2G 0 lvm [SWAP]
$ fdisk
$ cfdisk
Demo
Create and Configure
File Systems
Create and Configure File Systems
>_
$ sudo mkfs.xfs /dev/vdb1 make filesystem
>_
$ ls /mnt/
$ ls -l /mnt/
-rw-rw-r--. 1 aaron aaron 30 Jan 31 14:30 testfile
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 8:0 0 20G 0 disk
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
├─cs-root 253:0 0 17G 0 lvm /
└─cs-swap 253:1 0 2G 0 lvm [SWAP]
vdb 8:16 0 10G 0 disk
├─vdb1 8:17 0 4G 0 part
├─vdb2 8:18 0 4G 0 part
└─vdb3 8:19 0 2G 0 part /mnt
Mount Filesystems At or During Boot
>_
$ sudo umount /mnt/
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 8:0 0 20G 0 disk
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
├─cs-root 253:0 0 17G 0 lvm /
└─cs-swap 253:1 0 2G 0 lvm [SWAP]
vdb 8:16 0 10G 0 disk
├─vdb1 8:17 0 4G 0 part
├─vdb2 8:18 0 4G 0 part
└─vdb3 8:19 0 2G 0 part
$ ls /mnt/
Mount Filesystems At or During Boot
>_
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 8:0 0 20G 0 disk
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
├─cs-root 253:0 0 17G 0 lvm /
└─cs-swap 253:1 0 2G 0 lvm [SWAP]
vdb 8:16 0 10G 0 disk
├─vdb1 8:17 0 4G 0 part
├─vdb2 8:18 0 4G 0 part
└─vdb3 8:19 0 2G 0 part
>_ /etc/fstab
$ sudo vim /etc/fstab /dev/mapper/cs-root / xfs defaults 00
>_
$ ls /mybackups/
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 8:0 0 20G 0 disk
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
├─cs-root 253:0 0 17G 0 lvm /
└─cs-swap 253:1 0 2G 0 lvm [SWAP]
vdb 8:16 0 10G 0 disk
├─vdb1 8:17 0 4G 0 part
├─vdb2 8:18 0 4G 0 part
└─vdb3 8:19 0 2G 0 part
Mount Filesystems At or During Boot
>_
$ sudo systemctl reboot
$ ls -l /mybackups/
-rw-rw-r--. 1 aaron aaron 30 Jan 31 14:30 testfile
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 8:0 0 20G 0 disk
├─vda1 8:1 0 1G 0 part /boot
└─vda2 8:2 0 19G 0 part
├─cs-root 253:0 0 17G 0 lvm /
└─cs-swap 253:1 0 2G 0 lvm [SWAP]
vdb 8:16 0 10G 0 disk
├─vdb1 8:17 0 4G 0 part
├─vdb2 8:18 0 4G 0 part /mybackups
└─vdb3 8:19 0 2G 0 part
Mount Filesystems At or During Boot
>_
$ man fstab
FSTAB(5) File Formats FSTAB(5)
NAME
fstab - static information about the filesystems
SYNOPSIS
/etc/fstab
DESCRIPTION
The file fstab contains descriptive information about the filesystems the system can mount. fstab
is only read by programs, and not written; it is the duty of the system administrator to properly
create and maintain this file. The order of records in fstab is important because fsck(8),
mount(8), and umount(8) sequentially iterate through fstab doing their thing.
Each filesystem is described on a separate line. Fields on each line are separated by tabs or
spaces. Lines starting with '#' are comments. Blank lines are ignored.
>_ /etc/fstab
/dev/mapper/cs-swap none swap defaults 00
$ sudo vim /etc/fstab
/dev/vdb3 none swap defaults 00
$ swapon --show
NAME TYPE SIZE USED PRIO
/dev/vdb3 partition 2G 0B -2
/dev/dm-1 partition 2G 0B -3
Mount Filesystems At or During Boot
>_ /etc/fstab
UUID=3b93b1ba-e44a-4f75-aa38-c93ed32e34e2 /boot xfs defaults 00
$ sudo vim /etc/fstab
/dev/vda1 /boot xfs defaults 00
/backups/
On Demand Mounting
Fileserver
Mount Filesystems on Demand
>_
$ sudo dnf install autofs
>_
$ sudo dnf install nfs-utils
>_ /etc/exports
/etc 127.0.0.1(ro)
$ sudo vim /etc/exports
>_ /etc/auto.master
/shares/ /etc/auto.shares --timeout=400
$ sudo vim /etc/auto.master
Mount Filesystems on Demand
>_ /etc/auto.shares
mynetworkshare -fstype=auto 127.0.0.1:/etc
$ sudo vim /etc/auto.shares
>_
$ sudo systemctl reload autofs
$ ls /shares/
$ ls /shares/mynetworkshare/
mysharedfile1 mysharedfile2
Mount Filesystems on Demand
>_ /etc/auto.master
/shares/ /etc/auto.shares --timeout=400
$ sudo vim /etc/auto.master
/- /etc/auto.shares --timeout=400
Mount Filesystems on Demand
>_ /etc/auto.shares
mynetworkshare -fstype=auto 127.0.0.1:/etc
$ sudo vim /etc/auto.shares
myext4files -fstype=auto :/dev/vdb2
$ ls /mynetworkshare/
mysharedfile1 mysharedfile2
$ ls /localfiles/myext4files/
mysharedfile3 mysharedfile4
Create and Manage Hard Links
Inodes
>_
family_dog.jpg
$ stat Pictures/family_dog.jpg
File: Pictures/family_dog.jpg
Size: 49 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 52946177 Links: 1
Access: (0640/-rw-r-----) Uid: ( 1000/ aaron) Gid: ( 1005/ family)
Context: unconfined_u:object_r:user_home_t:s0 52946177
Inode
Access: 2021-10-27 16:33:18.949749912 -0500
Modify: 2021-10-27 14:41:19.207278881 -0500 Permissions Access Time
Change: 2021-10-27 16:33:18.851749919 -0500
Birth: 2021-10-26 13:37:17.980969655 -0500
Hard Links
>_
family_dog.jpg
$ stat Pictures/family_dog.jpg
File: Pictures/family_dog.jpg
Size: 49 Blocks: 8 IO Block: 4096 regular file Hard Link
Device: fd00h/64768d Inode: 52946177 Links: 1
Access: (0640/-rw-r-----) Uid: ( 1000/ aaron) Gid: ( 1005/ family)
Context: unconfined_u:object_r:user_home_t:s0 52946177
Inode 1
Access: 2021-10-27 16:33:18.949749912 -0500
Modify: 2021-10-27 14:41:19.207278881 -0500 Permissions Access Time
Change: 2021-10-27 16:33:18.851749919 -0500
Birth: 2021-10-26 13:37:17.980969655 -0500
Hard Links
>_ home
$ cp –r /home/aaron/Pictures/ /home/jane/Pictures/
$ ln /home/aaron/Pictures/family_dog.jpg /home/jane/Pictures/family_dog.jpg
copy
$ stat Pictures/family_dog.jpg
family_dog.jpg family_dog.jpg
File: Pictures/family_dog.jpg
Size: 49 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 52946177 Links: 2
Access: (0640/-rw-r-----) Uid: ( 1000/ aaron) Gid: ( 1005/ family)
Context: unconfined_u:object_r:user_home_t:s0 52946177
Inode 2
1
Access: 2021-10-27 16:33:18.949749912 -0500
Permissions Access Time
Modify: 2021-10-27 14:41:19.207278881 -0500
Change: 2021-10-27 16:33:18.851749919 -0500
Birth: 2021-10-26 13:37:17.980969655 -0500
$ rm /home/aaron/Pictures/family_dog.jpg
$ rm /home/jane/Pictures/family_dog.jpg
Limitations and Considerations
>_
Only hardlink to files, not folders
$ useradd –a –G family aaron
/home/aaron/file /mnt/Backups/file
Create and Manage Soft Links
Soft Links
C:\Program Files\MyCoolApp\application.exe
Soft Links
>_
# ln -s path_to_target_file path_to_link_file
family_dog_shortcut.jpg
$ ln –s /home/aaron/Pictures/family_dog.jpg family_dog_shortcut.jpg
Soft Link
$ ls -l
lrwxrwxrwx. 1 aaron aaron family_dog_shortcut.jpg -> /home/aaron/Pictures..
$ readlink family_dog_shortcut.jpg
family_dog.jpg
/home/aaron/Pictures/family_dog.jpg
Hard Link
$ echo “Test” >> fstab_shortcut
$ ls -l
lrwxrwxrwx. 1 aaron aaron family_dog_shortcut.jpg -> /home/aaron/Pictures..
>_
Softlink to files and folders
/home/aaron/file /mnt/Backups/file
List, Set, and
Change File Permissions
Owners and Groups
>_
$ ls -l
-rw-r-----. 1 aaron family 49 Oct 27 14:41 family_dog.jpg
$ ls -l
-rw-r-----. 1 aaron wheel 49 Oct 27 14:41 family_dog.jpg
$ groups aaron
jane family
wheel
aaron wheel family
$ ls -l
- r w x r w x r w x . 1 aaron family 49 Oct 27 14:41 family_dog.jpg
REGULAR FILE -
CHARACTER DEVICE c
LINK l
SOCKET FILE s
PIPE p
BLOCK DEVICE b
File and Directory Permissions
rwxrwxrwx
owner Group Others
u g o
Bit Purpose
r Read File
w Write to File
x Execute (run)
- No permission
Directory Permissions
>_
$ ls Pictures/
$ mkdir Pictures/Family
$ cd Pictures/
Bit Purpose
r Read Directory
w Write to Directory
x Execute into
- No permission
Evaluating Permissions
>_
(aaron)$ ls -l
-r--rw----. 1 aaron family 49 family_dog.jpg
(aaron)$ su jane
-r--rw----
(jane)$ echo “Add this content to file” >> family_dog.jpg owner Group Others
u g o
(jane)$ cat family_dog.jpg
Picture of Milo the dog
Adding Permissions
>_
>_
$ ls -l
-r--rw-r--. 1 aaron family 49 Oct 27 14:41 family_dog.jpg
u-[list of permissions]
>_
$ ls -l
-r--rw----. 1 aaron family 49 Oct 27 14:41 family_dog.jpg
u=[list of permissions]
$ chmod g=r family_dog.jpg
$ ls -l
-r--r-----. 1 aaron family 49 Oct 27 14:41 family_dog.jpg
Option Examples
$ chmod g=rw family_dog.jpg user u= u=w / u=rw / u=rwx
$ chmod g= family_dog.jpg
$ ls -l
-r--------. 1 aaron family 49 Oct 27 14:41 family_dog.jpg
>_
$ ls -l
-r--------. 1 aaron family 49 Oct 27 14:41 family_dog.jpg
>_
$ stat family_dog.jpg
File: family_dog.jpg
Size: 49 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 52946177 Links: 1
Access: (0640/-rw-r-----) Uid: ( 1000/ aaron) Gid: ( 10/ wheel)
Octal Permissions
001 1
011
2
100 4
7 5 5
101 5
110 6
r1 w1 x1 r1 w1 x1 r1 w1 x1 111 7
7 7 7
Octal Permissions
w 2
7 5 5 x 1
r4 w2 x1 r4 w2 x1 r4 w2 x1
7 7 7
Octal Permissions
>_
$ stat family_dog.jpg
File: family_dog.jpg
Size: 49 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 52946177 Links: 1
Access: (0640/-rw-r-----) Uid: ( 1000/ aaron) Gid: ( 10/ wheel)
Transparent compression
SSD optimizations
Online defragmentation
Offline checks
Deduplication
btrfs
Copy-on-write filesystem
>_ raid0
$ sudo mkfs.btrfs /dev/sdb1 raid1
raid5
raid6
$ sudo mkfs.btrfs /dev/sdb1 -L "New Disk" raid10
single
$ sudo mkfs.btrfs -d single -m single /dev/sdb /dev/sdc dup
Sub-volumes
>_
$ sudo btrfs subvolume create /mnt/disk/BKP
$ ls -lh /mnt/disk/
total 0
drwxr-xr-x 1 root root 0 jul 13 17:35 BKP
drwxrwxr-x 1 carol carol 988 jul 13 17:30 Images
>_
$ sudo btrfs subvolume snapshot /mnt/disk /mnt/disk/snap
$ ls -lh /mnt/disk/
total 2,8M
-rw-rw-r-- 1 carol carol 109K jul 10 16:22 Galaxy_Note_10.png
-rw-rw-r-- 1 carol carol 484K jul 5 15:01 geminoid2.jpg
-rw-rw-r-- 1 carol carol 429K jul 5 14:52 geminoid.jpg
-rw-rw-r-- 1 carol carol 467K jul 2 11:48 LG-G8S-ThinQ-Mirror-White.jpg
-rw-rw-r-- 1 carol carol 654K jul 2 11:39 LG-G8S-ThinQ-Range.jpg
-rw-rw-r-- 1 carol carol 94K jul 2 15:43 Mimoji_Comparativo.jpg
-rw-rw-r-- 1 carol carol 112K jul 10 16:20 Note10Plus.jpg
drwx------ 1 carol carol 366 jul 13 17:56 snap
-rw-rw-r-- 1 carol carol 118K jul 11 16:36 Twitter_Down_20190711.jpg
-rw-rw-r-- 1 carol carol 324K jul 2 15:22 Xiaomi_Mimoji.png
Snapshots
>_
$ rm LG-G8S-ThinQ-*
$ ls -lh /mnt/disk/
total 1,7M
-rw-rw-r-- 1 carol carol 109K jul 10 16:22 Galaxy_Note_10.png
-rw-rw-r-- 1 carol carol 484K jul 5 15:01 geminoid2.jpg
-rw-rw-r-- 1 carol carol 429K jul 5 14:52 geminoid.jpg
-rw-rw-r-- 1 carol carol 94K jul 2 15:43 Mimoji_Comparativo.jpg
-rw-rw-r-- 1 carol carol 112K jul 10 16:20 Note10Plus.jpg
drwx------ 1 carol carol 366 jul 13 17:56 snap
-rw-rw-r-- 1 carol carol 118K jul 11 16:36 Twitter_Down_20190711.jpg
-rw-rw-r-- 1 carol carol 324K jul 2 15:22 Xiaomi_Mimoji.png
$ ls -lh /mnt/disk/snap
total 2,8M
-rw-rw-r-- 1 carol carol 109K jul 10 16:22 Galaxy_Note_10.png
-rw-rw-r-- 1 carol carol 484K jul 5 15:01 geminoid2.jpg
-rw-rw-r-- 1 carol carol 429K jul 5 14:52 geminoid.jpg
-rw-rw-r-- 1 carol carol 467K jul 2 11:48 LG-G8S-ThinQ-Mirror-White.jpg
-rw-rw-r-- 1 carol carol 654K jul 2 11:39 LG-G8S-ThinQ-Range.jpg
-rw-rw-r-- 1 carol carol 94K jul 2 15:43 Mimoji_Comparativo.jpg
-rw-rw-r-- 1 carol carol 112K jul 10 16:20 Note10Plus.jpg
-rw-rw-r-- 1 carol carol 118K jul 11 16:36 Twitter_Down_20190711.jpg
-rw-rw-r-- 1 carol carol 324K jul 2 15:22 Xiaomi_Mimoji.png
Snapshots
>_
$ sudo btrfs subvolume snapshot -r /mnt/disk /mnt/disk/snap
Compression
Compression is transparent
/media/USER/LABEL
/media/john/FlashDrive
user
nouser
group
owner
/etc/systemd/system/mnt-external.mount
>_
$ sudo vi /etc/systemd/system/mnt-external.mount [Unit]
Description=External data disk
[Mount]
What=/dev/disk/by-uuid/56C11DCC5D2E1334
$ sudo systemctl daemon-reaload Where=/mnt/external
Type=ntfs
Options=defaults
$ sudo systemctl start mnt-external.mount [Install]
WantedBy=multi-user.target
Mounting with Systemd
>_
$ sudo systemctl status mnt-external.mount
mnt-external.mount - External data disk
Loaded: loaded (/etc/systemd/system/mnt-external.mount; disabled; vendor
pres
Active: active (mounted) since Mon 2019-08-19 22:27:02 -03; 14s ago
Where: /mnt/external
What: /dev/sdb1
Tasks: 0 (limit: 4915)
Memory: 128.0K
CGroup: /system.slice/mnt-external.mount
ago 19 22:27:02 pop-os systemd[1]: Mounting External data disk...
ago 19 22:27:02 pop-os systemd[1]: Mounted External data disk.
/etc/systemd/system/mnt-external.automount
>_
$ sudo vi /etc/systemd/system/mnt-external.automount [Unit]
Description=Automount for the external data disk
[Automount]
Where=/mnt/external
$ sudo systemctl daemon-reaload [Install]
WantedBy=multi-user.target
/ /root
/bin /run
/boot /sbin
/dev /srv
/etc /tmp
/home /usr
/lib /proc
/media /var
/mnt /var/tmp
/opt
Conclusion
Conclusion
Conclusion