Storage and Filesystems Flashcards
What is stored in /bin
Executable programs necessary for the system (in single user mode)
What is in /boot
Boot loader files
What is in /dev
Device files
What is in /etc
System and service config files
What is in /home
User data files/profiles
What is in /lib
Library files needed by executables
How to search for a file and not see search (access) errors?
find / -name STRING 2>/dev/null
What would you use [ ] for in a regex
To contain a list of possible values
What would you use - for in a regex
To describe a range of values
What is the . used for in a regex?
A wildcard for any single character
What is the ^ or $ used for in a regex
The ^ is used to reference finding something at the beginning of a line, the $ the end
What is the | used for in a regex?
Or
What would you use \ for in a regex?
Escape character : I.e you want to search for $ or “ not use them as expressions
How do you perform a regular expression (in grep)?
-E “EXPRESSION”
3 popular options for sort command
-k NUMBER (sort by a different column)
-r (reverse)
-t DELIMITER (, or “ “ )
How to change owner of file and group at the same time?
sudo chown USER:GROUP FILE
How to check if FACL is enabled
sudo tune2fs -l
And check for the line “ Default Mount Options”
How to set a FACL
setfacl -m or -s u:USER:PERM FILE
m for modify
s for set (new setup)
x for remove
How to assign default group permissions to a directory with FACL
setfacl -m d:g:GROUP:PERM DIR
What is grub2-mkconfig used for
Creating a new grub config file in protected (checked) manner
Where would you find the grub configuration
/boot/efi/EFI
/etc/grub.d
What is the boot process in 5 steps?
BIOS/UEFI
MBR/GPT
GRUB2
initrd/Kernel
systemd process
How do you check storage use on the system
df -h for system wide and -human readable
du -h —maxdepth=NUM DIR for directory and recursive also with sending errors from this 2>/dev/null
What is initrd.img
It’s the ram loading ‘boot image’ of initrd process