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
What is vmlinuz
This is the Kernel!
Ending with a z usually zipped, ending with a x unzipped.
rsync common options…
a archive
z zip
u update (skip existing files)
r recursive
P display progress
How to rsync thru SSH
rsync -OPTIONS -e SSH SOURCE USERNAME@HOST/IP DEST
How would you test a complicated rsync instruction
Use —dry-run at the end of it
What are the 3 integral parts of the SCSI framework?
Upper : device driver layer
Middle: SCSI routing
Lower: Host Bus Adapter
Less common ‘ls’ options
-d directory meta
-F classify file type
-R recursive tree
-Z security context
Create a hard link
ln /ORIGINAL /HARDLINK
Create a soft link
ln -s /ORIGINAL -/SOFTSYMBOLIC
common “rm” options
-d delete empty dirs
-f —force
-i ask before deletion
-I ask before deleting >3 files or during recursive
-R-r recursive
-v verbose
Which options in /etc/fstab designate filesystem with quotas
usrquota
grpquota