If you don’t know the options to a command, where do you go to look them up?
You can use man pages with man <command></command>
use -help
info command
Documentation in /usr/share/doc:
What is swap and when is it used?
Swap is a dedicated space on stoarge device that acts as virtual memory when the physical ram is being fully utilized.
-inactive data in RAM is moved to swap space, freeing up RAM for active processes.
Where would someone look to find system logs?
/var/log/syslog or /var/log/messages
- General system logs that include messages from the kernel and various system services
How can I see all processes that are running? How about which ones are taking up the most CPU/Memory?
How do you restart a service?
sudo systemctl restart <service-name></service-name>
How do you see what IP address is assigned to the box?
ip Command: This is the most common method on modern Linux systems.
- ip addr show
on older system: ifconfig
How do you install a package for both RHEL and Ubuntu/Debian?
For RHEL use yum install command
for ubuntu/debian use apt update/install
What is /etc/fstab used for?
The /etc/fstab file in Linux is a configuration file that defines how and where storage devices, filesystems, and partitions are automatically mounted on the system at boot time
How do you format a partition/drive?
1 - Identify the Partition/Drive: Use lsblk or fdisk -l to list all drives and partitions
2 - Unmount the Partition sudo umount /dev/sdX1
3 - Format the Partition:example ext4 sudo mkfs.ext4 /dev/sdX1
4 - Verify the Format: Use lsblk
5 - Mount the Partition sudo mkdir -p /mnt/mydrive
sudo mount /dev/sdX1 /mnt/mydrive
What is /root used for?
In Linux, the /root directory is the home directory for the root user, which is the superuser or administrator with full access to all system files and commands.
What is a user’s $PATH?
A user’s $PATH is an environment variable in Linux and Unix systems that specifies a list of directories the shell searches when you type a command
What various commands are used to extract files from an archive?
What is an inode, and what is it used for? What can you do with an inode?
An inode (index node) is a fundamental data structure
What Is It Used For?: Inodes allow the file system to manage files efficiently, providing quick access to file metadata without needing to read the entire file. By maintaining metadata separately, the file system can keep track of files and directories even if their names change.
what can you do?
- Access File Metadata:
- Check Inode Usage: Use df -i to check the inode usage of a file system, which helps determine how many inodes are free or used.
- Hard Links: You can create hard links to a file. Multiple filenames can point to the same inode, allowing the same data to be accessible by different names.
- Inode Recovery: Tools like fsck (file system check) can be used to repair file systems, checking and fixing issues with inodes.
- View Inode Details: You can use the stat command to display detailed information about a file, including its inode number:
What commands would be used to add a new drive to a volume group and extend a logical volume?
What is /proc used for? How about /sys?
How do you display which kernel modules are loaded? How do you load a module? Where do you configure it so a module loads on boot? How do you unload a module?
how to. display: lsmod
modinfo <module_name>
cat /proc/modules</module_name>
how to load: To load a kernel module, you use the modprobe or insmod command:
load on boot: To configure a kernel module to load automatically at boot, you can add it to the appropriate configuration file: Add the module name to the /etc/modules file:
to unload: To unload a kernel module, you can use the modprobe or rmmod command:
What is “load average”? What intervals is load average shown as? How do you show the load average?
Load average is a system performance metric that represents the average number of processes that are either in a runnable state (actively using CPU) or waiting for CPU time over a specific period. It helps gauge how busy the system is
Load average is typically displayed for three time intervals:
1 minute: The average load over the last minute. 5 minutes: The average load over the last five minutes. 15 minutes: The average load over the last fifteen minutes.
You can view the load average in several ways:
Using the uptime Command:
How do you show which ports are being listened on?
The netstat command can display network connections, routing tables, interface statistics, and more. To see only listening ports, use: netstat -tuln
The ss (socket statistics) command is a modern replacement for netstat. To list listening ports, you can use: