4 - Linux Fundamentals Flashcards
What part of your computer system is Linux?
The OS kernel. Coordinates between hardware, software, users and files.
What is User Space
Everything that happens outside of the kernel
What starts the OS kernel?
The bootloader
What starts the computer’s bootloader?
BIOS/UEFI
What is “ring zero”?
kernel space
Where does the kernel export data about hardware (as virtual files)?
/proc/
and /sys/
Where does the kernel present the virtual files representing hardware such as HIDs and drive partitions?
/dev/
What are the two types of device files?
Block and Character
What Linux command can you use to determine if a device file is a block file or a character file?
ls -l
Are disk drives in /dev/
more likely to be block devices or character devices?
Block devices
Are peripherals and serial ports in /dev/
more likely to be block devices or character devices?
Character devices
Which system can be used to issue device-specific commands to devices?
ioctl
What is the file path for the root of the Linux virtual file tree?
/
What is the file path for a user home?
/home/username
What is the command used to mount a disk?
mount
What would mkfs.ext4 /dev/sda1
do?
Format the disk at sda1
to the ext4
filesystem.
What is a Process?
A running instance of a program.
What is a PID?
Process Identifier, the reference for a running process.
How many things can a CPU core do at once?
one
What user account do processes run under?
The user who started the process.
How can you get a command line if your GUI is broken?
Launch a virtual console with CTRL+ALT+F1
(F1 through F6 all work)
What does the pwd
command do?
(Print Working Directory) Prints the current location yur shell is working in.
What is the command to change directories?
cd
followed by an absolute or relative path.
What does cd -
do?
Takes you to the last directory you navigated away from.
What command takes you to the parent directory?
cd ..
What is the command to create a directory?
mkdir directoryName
Which command is for moving or renaming files or directories?
mv
Which command is for removing an empty directory?
rmdir directoryName
Which command is for removing a file?
rm fileName
What command means “copy”?
cp
Which command lists directory contents?
ls
When you try to run a program, where is Linux looking for the program to run?
The list of directories in the PATH
environment variable.
What does echo $PATH
do?
Shows the list of directories in your PATH environment variable.
What are common paths for executable commands?
/usr/local/sbin
,/usr/local/bin
,/usr/sbin
,usr/bin
,/sbin
,/bin
How do you ask Linux about the location of a command.
type
followed by the command shows the command’s path.
“In penetration tests, you will most often receive shell access to a system after a successful exploit, rather than a graphical user interface. Proficiency with the command line is essential for your success as a security professional.”
Did you know that?
How can you print the contents of an environment variable to the screen?
echo $VAR
Where are two places system variables can be placed, for use by command line programs?
/etc/profile
and ~/.profile
Where should you save environment variables to make them available to all sessions regardless of whether a shell has been executed?
etc/environment
FHS
Filesystem Hierarchy Standard
/bin/
basic programs
/boot/
Kali Linux kernel and other files required for its early boot process
/dev/
device files
/etc/
configuration files
/home/
user’s personal files
/lib/
basic libraries
/media/
mount points for removable drives (usb, dvd)
/mnt/
temporary mount point