WorksheetsЛИНУКС WEEK 5, 6, 9
Total questions: 90
Worksheet time: 45mins
What is the role of the CPU in a computer system?
It stores data temporarily
It performs calculations and manipulates data
It manages power supply to the system
It controls input and output devices
What command can you use to display detailed CPU information on a Linux system?
uname -a
lscpu
lsmod
df -h
What does the uname command with the -a option display?
Detailed hardware information
System memory usage
Full system information including kernel and architecture
Disk usage statistics
Which component is considered core hardware in a computer system?
Printer
USB hub
Central Processing Unit (CPU)
Bluetooth adapter
What is the maximum amount of RAM that can be theoretically used with a 64-bit processor?
4 GB
16 EB
32 GB
1 TB
How can you check the total amount of memory in your Linux system?
free
lsusb
top
uname -p
What is the function of swap space in Linux?
It is used for storing system logs
It is virtual memory used when RAM is full
It stores bootloader information
It is reserved for application data
Which type of storage device connects directly to the system board via a cable in modern systems?
SATA
SCSI
IDE
USB
What does the df -h command do?
Displays system memory usage
Shows file system disk space usage in human-readable format
Displays detailed CPU information
Lists active processes
Which of the following is a hotplug device?
Hard drive
USB drive
IDE drive
Optical drive
How can you view a list of connected PCI devices on your system?
lsusb
lspci
uname -m
dmesg
What does the lsusb command do?
Lists USB devices connected to the system
Lists PCI devices connected to the system
Shows memory usage
Displays detailed process information
Which command shows detailed information about USB devices?
usbinfo
lsusb -v
df -h
uname -p
Which file contains information about the system's RAM usage?
/proc/ioports
/sys/meminfo
/proc/meminfo
/var/log/messages
What does the lspci -v command show?
Lists kernel modules
Displays detailed PCI device information
Shows CPU details
Lists connected USB devices
What type of devices can lsusb show?
Network cards
USB devices
RAM details
PCI devices
How can you view kernel messages after connecting a new device?
lsmod
dmesg
lspci
lsusb -v
What is the primary function of udev in Linux?
It manages device nodes in the /dev directory
It monitors system memory usage
It manages CPU resources
It lists running processes
Which command shows a list of currently loaded kernel modules?
lsmod
uname
lspci
top
What command can be used to get more information about a specific kernel module?
modprobe -l
uname -p
modinfo
lsmod -v
What does the df -h command display?
Detailed CPU information
Mounted filesystem disk space usage
Kernel version
USB device list
What is the default bootloader used on most Linux systems?
LILO
GRUB
SILO
PXE
What is the purpose of the BIOS in a system's boot process?
Manages the operating system after booting
Loads the kernel into memory
Manages hardware and initializes the bootloader
Performs file system checks
What is the main role of the Linux kernel during the boot process?
Initializes hardware and mounts the root filesystem
Manages system memory
Handles user logins
Loads the bootloader into memory
Which command would you use to view real-time kernel messages related to system devices?
lspci
dmesg
lsusb
modprobe -l
What is the function of modprobe in Linux?
Loads and unloads kernel modules
Displays memory usage
Manages USB devices
Shows CPU information
What is initramfs used for in the boot process?
To manage memory allocation during boot
To provide drivers and tools for the real root filesystem to load
To initialize hardware
To list the PCI devices connected
What does the dmesg command output?
Kernel ring buffer messages
CPU details
Kernel module information
Process tree
How can you unload a kernel module in Linux?
lsmod
modprobe -r
df -h
lspci -r
What is the function of the journalctl command?
View system logs managed by systemd
Display memory usage
Monitor kernel modules
List attached USB devices
What is the purpose of partitioning a hard drive in Linux?
To speed up the system
To organize files and directories efficiently
To allow multiple operating systems to coexist
To increase disk space
What is the first step in creating a partition on a Linux system?
Format the partition
Divide the hard drive into partitions
Install a bootloader
Mount the partition
Which tool is commonly used to create partitions in Linux?
ls
mount
fdisk
ps
What does MBR stand for in partitioning?
Master Boot Record
Main Boot Register
Modern Boot Record
Major Boot Registry
How many primary partitions can be created on an MBR-partitioned disk?
4
2
6
8
What is an extended partition used for?
To hold a bootloader
To allow additional partitions beyond the primary partition limit
To store large files
To mount filesystems
Which partitioning type supports disks larger than 2TB?
MBR
GPT
BIOS
NTFS
What is the maximum number of partitions supported by GPT?
4
128
16
256
Which tool is used to create and manage GPT partitions?
fdisk
gdisk
gparted
sfdisk
What is the purpose of a filesystem in Linux?
To store hardware information
To organize and store files and directories on a partition
To manage memory usage
To install operating systems
Which of the following filesystems is known for being used on optical discs?
ext4
xfs
ISO 9660
vfat
What does the term "journaling" in a filesystem refer to?
Logging all user activities
Recording file changes to ensure recovery after crashes
Creating backups of directories
Compressing files for storage
Which of the following is a non-journaling filesystem?
ext4
ext3
ext2
xfs
Which filesystem is known for efficiently handling large files and is the default for RHEL 7?
ext2
xfs
vfat
ntfs
What command is used to list currently mounted filesystems?
ls
df
mount
lsmod
Which command displays a summary of disk space usage in human-readable format?
mount
lsblk
df -h
du -h
How do you mount a filesystem manually in Linux?
Use the mount command
Use the fdisk command
Use the lsblk command
Use the df command
Which directory is used as the default location to mount filesystems temporarily?
/home
/tmp
/mnt
/var
What does the /dev directory contain in Linux?
User files
System logs
Device files
Configuration files
What command is used to display the partition table of a disk?
lsblk
mount
fdisk -l
dmesg
What does the command mkfs do?
Mounts a filesystem
Creates a new filesystem
Deletes a filesystem
Lists filesystem types
How can you resize a partition non-destructively in Linux?
fdisk
parted
sfdisk
fsck
What is the function of the swap partition in Linux?
Stores user files
Extends physical memory by using disk space as virtual memory
Holds system logs
Contains bootloader files
Which partition is critical for booting a UEFI system?
/boot/efi
/var
/usr
/home
What does the sfdisk command allow you to do?
Create bootloaders
Modify partition tables using scripts
Monitor system memory
Display CPU information
How can you make changes to partitions on a running system without rebooting?
Use the dmesg command
Use the partprobe command
Use the fsck command
Use the lsmod command
What is the purpose of the /etc/fstab file?
To monitor system processes
To list devices to mount automatically at boot
To configure kernel modules
To store user profiles
What does the umount command do in Linux?
Formats a partition
Unmounts a filesystem
Creates a new filesystem
Lists mounted devices
What command displays all available block devices on the system?
df -h
lsblk
mount -a
fdisk -l
How can you back up the partition table in Linux?
mkfs -l
sfdisk -d
lsblk --backup
parted -s
What is the primary reason Linux administrators prefer the command line interface over the GUI?
It is easier to use
It consumes fewer system resources
It is more visually appealing
It supports better graphics
Which file is used to permanently customize the environment for all users in a system?
~/.bashrc
~/.profile
/etc/profile
~/.bash_logout
How do you assign a value to a variable in the shell?
variable = value
variable == value
variable = "value"
variable="value"
Which command displays all environment variables?
env
declare -x
export -p
All of the above
What is the purpose of the PATH variable?
To store the user's login history
To define the directories searched for commands
To list all files in the system
To set user permissions
What command can be used to unset a variable in the shell?
delete
remove
unset
clear
Which file stores the history of commands executed in Bash by default?
~/.history
~/.bashrc
~/.bash_history
~/.profile
What does the command alias ll='ls -alF' do?
Creates a new user named ll
Runs the command ls -alF
Creates an alias ll for ls -alF
Sets a variable named ll
Which of the following operators is used for sequential execution of commands?
&&
||
;
&
What is the function of the export command?
Display all environment variables
Make a local variable available to subshells
Unset a variable
Rename a variable
Which command temporarily modifies the PATH variable for a single command?
set PATH
modify PATH
env PATH=value command
export PATH=value
What does the echo $PATH command display?
Current user's environment variables
Current shell options
Directories listed in the PATH variable
Active background processes
What does the type command do?
Displays the type of shell being used
Identifies if a command is a built-in, alias, or executable
Prints the contents of a file
Executes a given shell script
Which file contains aliases and variables specific to an individual user?
/etc/bashrc
/etc/profile
~/.bashrc
~/.bash_profile
What command can make an alias permanent?
export alias
Save the alias in ~/.bashrc
Use alias --permanent
Use unalias
What is the correct syntax for creating a function in Bash?
function_name { commands }
function_name [ commands ]
function function_name { commands }
function_name = { commands }
How do you display the value of a specific variable in the shell?
print variable
display variable
echo $variable
show variable
Which special character is used to append data to a file in a script?
>
>>
|
||
What is the purpose of the chmod u+x command?
Change file permissions to executable for the user
Copy a file to the user's home directory
Remove a file from the system
Set the default file permissions
Which file is used to execute commands upon a user's logout?
~/.bashrc
~/.bash_logout
~/.profile
/etc/profile
How can you execute a script named myscript.sh in the current directory?
Which of the following operators is used for conditional execution based on success?
;
||
&&
&
Which command reads user input during script execution?
input
echo
read
scanf
What does the -z option test in a conditional statement?
If a file exists
If a string is empty
If a variable is numeric
If a string is non-empty
What is the purpose of the shebang (#!/bin/bash) at the start of a script?
To define the path to the script
To specify the shell for script execution
To create a comment in the script
To execute the script immediately
Which command would you use to find out if a directory exists in a script?
test -d directory
check directory
ls directory
dir directory
What is the default command history size in Bash?
100
500
1000
50
What does the command unalias alias_name do?
Creates an alias
Removes an alias
Lists all aliases
Makes an alias permanent
How do you make an environment variable permanent for a user?
Set it in ~/.bashrc or ~/.profile
Use the export command
Set it in the /etc/profile file
Restart the shell
What does the pwd command display?
Parent directory of the user
Current working directory
Previous directory
Home directory
