Preparing for the LPIC-1 certification or looking to build a solid foundation in Linux system administration? This guide is designed to walk you through major topics covered by the LPIC-1 exam, session by session, with practical exercises and real-world examples.
What is LPIC-1?
The LPIC-1 (Linux Professional Institute Certification Level 1) is a globally recognized certification that validates your ability to perform maintenance tasks on the command line, install and configure a Linux system, and configure basic networking. The objectives are vendor-neutral and focus on practical, hands-on skills.
About this Guide:
This article is structured as a 20-day learning program, with each “day” or session focusing on a specific LPIC-1 objective. You’ll find:
- Key concepts explained in clear language
- Essential commands and configuration examples
- Step-by-step exercises to reinforce your learning
- Best practices and exam tips
Day 1: Introduction & Linux Installation
Objectives:
- Understand the kernel, OS, and shell.
- Why Linux? (Free, open source, multi-user, reliable, secure)
- Installation steps (CentOS/Ubuntu, VM setup, boot sequence).
- Boot-up process: BIOS → MBR → GRUB → Kernel → Init.
- Basic shell commands.
Key Concepts:
- Kernel: The core program managing hardware, software, filesystems, and memory.
- Shell: Command interpreter (bash is default).
- Boot Process: BIOS (POST) → MBR (bootloader) → GRUB → Kernel → Initrd → Init process.
- Useful Commands:
cd
,ls
,echo
,pwd
,rm
,mv
,cp
,mkdir
,rmdir
,touch
,exec
,man
,history
,cat
,time
.
Exercise 1:
Install a Linux distribution (such as Ubuntu or CentOS) in a virtual machine. Document each step, including downloading the ISO, creating the VM, configuring boot order, and completing the installation wizard.
Exercise 2:
After installation, open a terminal and practice basic navigation:
- Use
pwd
,ls
,cd
,mkdir
,touch
, andrm
to create and manage directories and files. - Use
man
to read the manual for at least three commands.
Day 2: Streams, Pipes, and Redirection
Objectives:
- Master command line tools, streams (stdin, stdout, stderr), redirection, and piping.
Key Concepts:
- Streams:
- stdin (0): Keyboard input
- stdout (1): Screen output
- stderr (2): Error output
- Redirection:
>
: Redirect output to file (overwrite)>>
: Append output to file<
: Use file as input<<
: Here-document (inline input)
- Pipes (
|
): Connect commands, e.g.,ls -lt | head
- Filters:
grep
,sort
,uniq
,cut
,wc
,head
,tail
,less
,cat
,tr
,expand
,unexpand
,split
,tac
,nl
,pr
Exercise 1:
Create three text files in different directories without changing your working directory. Use redirection (>
, >>
) to write content to them. Then, use pipes (|
) to combine commands (e.g., cat
, grep
, sort
) and redirect the output to a new file.
Exercise 2:
Write a command that finds all .conf
files in /etc
, sorts them alphabetically, and writes the first five results to conf_list.txt
.
Exercise 3:
In /var/log
, find all files modified in the last 24 hours. Use a single command to extract all lines containing the word “error” (case-insensitive) from these files, sort them by timestamp, and save the output to /tmp/errors_today.log
.
Hint: Use find
, grep
, sort
, and redirection.
Exercise 4:
Write a one-liner that counts the number of unique IP addresses that have accessed your web server today, assuming logs are in /var/log/apache2/access.log
. Save the result to /tmp/unique_ips.txt
.
Day 3: Regular Expressions & Process Management
Objectives:
- Use regular expressions with
grep
andsed
. - Edit files with
vi
. - Create, monitor, and kill processes.
- Modify process priorities.
Key Concepts:
- Regular Expressions:
grep
for searching,sed
for editing.- Basic vs. extended regex.
- vi Editor:
- Modes: Command (
i
,a
,o
,yy
,dd
,p
,A
,x
), Insert, Ex. - Save/quit:
:wq
,:w
,:q!
- Modes: Command (
- Process Management:
ps
,top
,jobs
,fg
,bg
,nice
,renice
,kill
- Foreground/background:
Ctrl+Z
,jobs
,fg %jobid
,bg %jobid
- Signals:
kill -9 PID
(SIGKILL),kill -15 PID
(SIGTERM)
Exercise 1:
Use grep
with a regular expression to find all lines containing an email address in /etc/passwd
.
Edit a file using vi
or vim
, practicing insert, command, and ex modes.
Exercise 2:
Start two background processes using sleep 1000 &
. Use ps
, jobs
, fg
, bg
, kill
, and nice
to manage and terminate them. Document the effect of each command.
Exercise 3:
Write a regular expression using grep
to extract all valid IPv4 addresses from /etc/hosts
and save them to /tmp/hosts_ips.txt
.
Then, use sed
to replace all occurrences of 127.0.0.1
with localhost
in a copy of /etc/hosts
.
Exercise 4:
Start three background processes running sleep 600
. Use ps
and pgrep
to find their PIDs. Change the priority of one process to the highest (-20
) and another to the lowest (19
). Kill the third process using its PID. Document each step and the effect.
Day 4: Monitoring Processes & RPM
Objectives:
- Monitor and kill processes.
- Use RPM for package management.
Key Concepts:
- RPM:
- Install:
rpm -i package.rpm
- Upgrade:
rpm -U package.rpm
- Remove:
rpm -e package
- Query:
rpm -qa
,rpm -qi
,rpm -qf /usr/bin/file
- Verify:
rpm -V package
- Build:
rpm -b
,rpm --rebuild
- Install:
- Practice:
- Install packages with dependencies, create local repo, use
createrepo
,yum install
,yum remove
,yum update
.
- Install packages with dependencies, create local repo, use
Exercise 1:
List all running processes using ps aux
and top
. Identify the PID of a process and change its priority using renice
.
Exercise 2:
Install a package using rpm
(or yum
/dnf
if available). Remove it, then reinstall it, and verify its files using rpm -ql <package>
.
Exercise 3:
Install the htop
package using RPM (not YUM or DNF). If dependencies are missing, resolve them manually. After installation, run htop
, take a screenshot, and save it to your home directory.
Exercise 4:
Accidentally delete /etc/ssh/sshd_config
. Use RPM to identify which package provides this file, reinstall only the configuration file, and verify that the SSH service starts successfully.
Day 5: Package Management & Shared Libraries
Objectives:
- Use RPM and YUM.
- Manage shared libraries.
- Understand Debian package management.
Key Concepts:
- YUM:
- Install:
yum install package
- Remove:
yum remove package
- Update:
yum update package
- List:
yum list available
,yum list installed
- Provides:
yum provides filename
- Clean:
yum clean all
- Install:
- Shared Libraries:
ldconfig -v
(update links/cache)ldd /usr/bin/ls
(list dependencies)
- Source Installation:
gunzip file.tar.gz
,tar -xvf file.tar
,./configure
,make
,make install
Exercise 1:
Delete /etc/autofs.conf
(after backing it up). Use rpm
to restore the file from the package.
Exercise 2:
Create a local YUM repository on your system. Add a package to it, configure the repository file, and install the package using yum
.
Exercise 3:
Create a local YUM repository in /srv/localrepo
. Download at least two RPM packages (e.g., curl
, wget
) and add them to your repo. Configure your system to use only this local repo (disable all others), then install both packages from your repo. Show how you verify the source of the installed packages.
Exercise 4:
Use ldd
to list all shared libraries required by /bin/bash
. Identify any missing libraries and explain how you would resolve such issues if they occurred.
Day 6: Hardware Settings, Filesystems, and Partitions
Objectives:
- Configure hardware (BIOS/UEFI, IRQ, I/O, DMA).
- Coldplug vs. hotplug devices.
- Manage kernel modules:
lsmod
,modinfo
,insmod
,modprobe
,rmmod
.
Key Concepts:
- BIOS/UEFI: Firmware for hardware initialization.
- IRQ/I/O/DMA: Hardware communication channels.
- Hotplug/Coldplug: Devices attachable while running/off.
- Kernel Modules:
- List:
lsmod
- Info:
modinfo module
- Load:
insmod
,modprobe
- Remove:
rmmod
,modprobe -r
- List:
- Partitioning Tools:
fdisk
,gdisk
,parted
Exercise 1:
List all PCI devices using lspci
and USB devices using lsusb
.
Check loaded kernel modules with lsmod
and display information about a module with modinfo
.
Exercise 2:
Add a new virtual disk to your VM. Partition it using fdisk
or gdisk
, and create an ext4 filesystem on it.
Exercise 3:
Add a new 10GB virtual disk to your VM. Partition it into two primary partitions: one 6GB (for /data
) and one 4GB (for swap). Format /data
as ext4 and set up the swap partition. Update /etc/fstab
for persistent mounting and activation. Reboot and verify both are active.
Exercise 4:
List all PCI and USB devices on your system. Identify the driver module used for your network card and display detailed information about it using modinfo
.
Day 7: Partitioning, Filesystem Check, Mounting
Objectives:
- Design HDD layout, create partitions, filesystems, and control mounting.
Key Concepts:
- Partitioning:
- MBR (BIOS): Up to 4 primary partitions.
- GPT (UEFI): Unlimited partitions.
- Tools:
fdisk
,gdisk
,parted
- Mount Points:
- Unified directory tree,
/etc/fstab
for permanent mounts.
- Unified directory tree,
- Filesystems:
- ext2, ext3, ext4, XFS, JFS, FAT, NTFS.
- Create:
mkfs -t ext3 /dev/sda6
- Swap:
mkswap /dev/sdb2
,swapon /dev/sdb2
Exercise 1:
Create two partitions on a new disk: one ext2 and one ext3. Mount them to /mnt/ext2
and /mnt/ext3
. Add entries to /etc/fstab
for persistent mounting.
Exercise 2:
Create and activate a swap partition using mkswap
and swapon
. Verify with free -h
.
Exercise 3:
Simulate a disk failure: Unmount /data
, then use dd
to write random data to the first 1MB of the partition. Attempt to mount it again (expect failure). Use fsck
to repair the filesystem, remount, and verify data integrity.
Exercise 4:
Create a new partition, format it as XFS, and mount it at /mnt/xfsdata
. Add an entry to /etc/fstab
with custom mount options: noatime
, nodev
, and nosuid
. Test that these options are active.
Day 8: Filesystem Integrity & File Management
Objectives:
- Maintain filesystem health.
- Advanced file management and archiving.
- Manage file ownership and links.
Key Concepts:
- Filesystem Tools:
dumpe2fs
,tune2fs
,debugfs
,fsck
- Only run fsck on unmounted/read-only filesystems.
- File Management:
ls
,file
,cat
,more
,less
,wc
,head
,tail
,touch
,cp
,dd
,mv
,rm
,mkdir
,rmdir
,grep
,sed
,tar
,gzip
,zcat
- Links:
- Hard links:
ln file hardlink
- Symbolic links:
ln -s file symlink
- Hard links:
- Ownership:
chown
,chgrp
Exercise 1:
Create three files in your home directory, write content to them, and archive them using tar
and cpio
.
Delete the originals, then restore them from the archive.
Exercise 2:
Create a hard link and a symbolic link to a file. Delete the original file and observe the behavior of each link.
Exercise 3:
Create a directory /backup_test
and three files inside it. Archive the directory using tar
with gzip compression, then delete the original files. Restore the archive to a new location /restore_test
and verify file integrity using md5sum
.
Exercise 4:
Create a file, a hard link, and a symbolic link to it. Change the content of the original file and observe the effect on both links. Then, delete the original file and observe the behavior of each link.
Day 9: File Permissions, Ownership, FHS
Objectives:
- Manage file permissions and ownership.
- Understand FHS (Filesystem Hierarchy Standard).
Key Concepts:
- Permissions:
- Codes:
-
(file),d
(dir),l
(link),p
(pipe),s
(socket),b
(block),c
(char) - Special bits: SUID, SGID, Sticky Bit
chmod
,umask
,chattr
- Codes:
- FHS:
/
,/boot
,/etc
,/bin
,/sbin
,/lib
,/usr
,/opt
,/home
,/root
,/var
,/tmp
,/mnt
,/dev
,/proc
- Shareable/unshareable, static/variable files
Exercise 1:
Create a file as root, then change its ownership to another user using chown
.
Set permissions to 644
and then to 600
using chmod
.
Experiment with umask
and document how it affects new files.
Exercise 2:
List all files in /usr/bin
with the SUID or SGID bit set using find /usr/bin/ -perm -u=s -o -perm -g=s
.
Exercise 3:
Create a script in /usr/local/bin
that prints “Hello, World!” and set its permissions so that only users in the developers
group can execute it. Set the SUID bit and explain its effect. Test the script as a user in and out of the group.
Exercise 4:
List all files in /usr/bin
with the sticky bit set. Explain the security implications of sticky, SUID, and SGID bits in multi-user environments.
Day 10: Booting System & Runlevel Management
Objectives:
- Boot the system, install boot managers, change runlevels, shutdown/reboot.
Key Concepts:
- Boot Process:
- MBR → GRUB → Kernel → Initrd → Init
- GRUB Legacy vs. GRUB2, config files
- Runlevels:
- 0 (halt), 1 (single user), 3 (multi-user), 5 (GUI), 6 (reboot)
- Ownership/Permissions:
chown
,chgrp
,umask
,ls -l
- Tools:
find
,locate
,whereis
,which
,type
Exercise 1:
Change the default runlevel (target) of your system to multi-user (no GUI) and then back to graphical mode.
Reboot and verify the change.
Exercise 2:
Install GRUB2 on a secondary disk. Add a custom menu entry for a test kernel or OS.
Exercise 3:
Change your system’s default target to multi-user (no GUI) using systemctl
. Reboot and verify. Then, switch to graphical mode without rebooting. Document the commands and results.
Exercise 4:
Install GRUB2 on a secondary disk. Add a custom menu entry that boots into single-user mode. Test the entry and reset the root password from this mode.
Day 11: Initialization (SysV, Systemd, Upstart)
Objectives:
- Understand SysV, systemd, and upstart initialization.
- Install and configure X11.
Key Concepts:
- SysV:
/etc/inittab
, runlevels, scripts in/etc/rc*.d/
- systemd:
- Units, targets,
systemctl
commands
- Units, targets,
- Upstart:
/etc/init/
, compatibility with SysV
- X11:
- Graphical environment, config files, runlevel 5,
startx
,xwininfo
,xdpyinfo
,xrandr
- Graphical environment, config files, runlevel 5,
Exercise 1:
List all enabled and active services using systemctl
.
Enable and disable a service (e.g., sshd
), then check its status.
Exercise 2:
Reset the root password by booting into single-user mode (init=/bin/bash or recovery mode).
Exercise 3:
List all enabled services at boot using systemctl
. Disable the cups
service, reboot, and verify it does not start. Then, enable it again and confirm.
Exercise 4:
Simulate a lost root password: Reboot into single-user mode (using GRUB), reset the root password, explain the process.
Day 12: X Server, Display Managers, Accessibility
Objectives:
- Install and configure X11 and display managers (LightDM).
- Manage accessibility and localization.
Key Concepts:
- X11 Services: Input, window, graphics, fonts, resource management.
- Display Managers: LightDM, GDM, KDM.
- Accessibility: Braille, high contrast, screen readers, sticky/bounce keys.
- Font Config:
fc-cache -fv
,.fonts
directory.
Exercise 1:
Install and configure LightDM or another display manager.
Change the default desktop environment for your user.
Exercise 2:
Configure a new font for X11 and verify it appears in graphical applications.
Exercise 3:
Install and configure LightDM as your display manager. Change the default session to XFCE (or another installed DE). Configure LightDM to disable guest logins and enable automatic login for a test user.
Exercise 4:
Download a new font, install it system-wide, and verify it appears in LibreOffice Writer. Document the steps and commands used.
Day 13: Printing, Manage Users and Groups
Objectives:
- Manage printers and printing.
- Administer user and group accounts.
Key Concepts:
- User Info:
/etc/passwd
,/etc/shadow
,getent passwd
- User Management:
useradd
,usermod
,userdel
,groupadd
,groupmod
,chage
- Printing: CUPS,
lp
,lpr
,lpstat
,lpadmin
Exercise 1:
Create two new users and two new groups. Assign users to groups and set their home directories and shells.
Exercise 2:
Install and configure CUPS. Add a printer (real or virtual), print a test page, and manage print jobs from the command line.
Exercise 3:
Create two users (alice
, bob
) and two groups (engineering
, hr
). Assign alice
to engineering
and bob
to both groups. Set up a shared directory /shared
accessible only to engineering
. Test access as both users.
Day 14: User Environment, System Logging, Schedule Jobs
Objectives:
- Tune user environment.
- System logging and log rotation.
- Automate tasks with cron and at.
Key Concepts:
- Shell Config:
/etc/profile
,/etc/bashrc
,~/.bashrc
,~/.profile
- Logging:
syslogd
,rsyslog
,systemd-journald
,/var/log/
- Scheduling:
cron
,crontab
,at
,anacron
- Log Rotation:
logrotate
,/etc/logrotate.d/*
Exercise 1:
Customize your .bashrc
to add an alias when you run “xx” it should list all files in the current directory with the selinux permissions. Add a custom prompt for your shell too.
Create a cron job that writes the current disk usage to /var/tmp/disk_usage.txt
every day at 2am. Check if any of the filesystems is over 90%, and if yes, send an email to the admin (i.e. your user).
Exercise 2:
Configure log rotation for a custom log file using logrotate
. Simulate log growth and force a rotation. Verify old logs are archived and new logs are created.
Exercise 3:
Customize /etc/skel/.bashrc
to include a custom prompt and alias for all new users. Create a new user and verify the changes.
Day 15: Network Configuration & Troubleshooting
Objectives:
- Configure network interfaces.
- Troubleshoot network issues.
Key Concepts:
- TCP/IP Stack: IP addressing, subnetting, classes, protocols.
- Tools:
hostname
,ifconfig
,ip
,route
,ping
,traceroute
,netstat
,tcpdump
,whois
,host
,dig
- DNS: Static vs. DHCP,
/etc/hostname
,/etc/sysconfig/network-scripts/ifcfg-*
- Routing:
ip addr add/del
,route add/del
,/proc/sys/net/ipv4/ip_forward
Exercise 1:
Configure a static IP address for your network interface.
Verify connectivity with ping
, traceroute
, and netstat
.
Exercise 2:
Write a script that checks all network interfaces and logs their status and IP addresses.
Exercise 3:
Configure a static IP address for eth0
in /etc/network/interfaces
(Debian/Ubuntu) or /etc/sysconfig/network-scripts/ifcfg-eth0
(RHEL/CentOS). Restart networking and verify with ip addr
. Test connectivity with ping
and traceroute
.
Exercise 4:
Write a script that checks all network interfaces, logs their status, IP addresses, and packet errors to /var/log/netcheck.log
. Schedule it to run every hour via cron.
Day 16: Security Administration
Objectives:
- Perform security admin tasks.
- Set up host security and encryption.
Key Concepts:
- SUID/SGID:
find /usr/bin/ -perm -u=s,g=s
,ls -l /bin/su
- PAM:
/etc/security/limits.conf
,/etc/pam.d/
,ulimit
- Password Aging:
chage
,passwd
,usermod
- Root Access:
su
,sudo
,/etc/sudoers
- User Activity:
who
,w
,last
,lastlog
- Network Security:
netstat
,lsof
,fuser
,nmap
Exercises:
- Save Ethernet config, disable NetworkManager, reconfigure IP/gateway, test persistence.
- List sockets, check SSH, capture packets with
tcpdump
, analyze with Wireshark. - Create user/group, set permissions, scan ports with
nmap
, activate services.
Exercise 1:
List all files with SUID/SGID bits set.
Configure password aging for a user bob
so the password expires every 30 days, with a 7-day warning.
Exercise 2:
Set resource limits for user alice
in /etc/security/limits.conf
(e.g., max 50 processes, 100MB memory). Log in as alice
and attempt to exceed these limits.
Exercise 3:
Install apache web server and create a simple web-page. Set apache to listen to port 80. In another terminal, use tshark to capture packets. Check if you can see the content of the packets and explain why.
Day 17: Shell Environment & Scripting
Objectives:
- Customize shell environment.
- Write and run simple scripts.
Key Concepts:
- Shebang:
#!/bin/bash
- Script Execution:
bash script.sh
,./script.sh
,source script.sh
,exec ./script.sh
- Variables: Assignment, reading, positional parameters (
$0
,$1
,$@
,$#
,$?
,$$
) - Conditionals:
if
,case
- Loops:
while
,for
- Functions:
function_name () { ... }
Exercise 1:
Write a shell script that accepts a directory as an argument and prints the number of files and total size. If size of the files under the directory is higher than 50% of it’s filesystem, then trigger an email to the admin.
Exercise 2:
Write a menu-driven script that allows the user to start, stop, or check the status of a given service. Include input validation and error handling.
Day 18: Shell Scripting (Continued)
Objectives:
- Advanced scripting: environment variables, command-line arguments, command substitution.
Key Concepts:
- MySQL Practice: Create DB, tables, insert/query data.
- Basics of SQL
Exercise 1:
Write a script that creates a backup of a given directory, compresses it, and stores it with a timestamp.
Exercise 2:
Write a script that reads a list of usernames from a file and creates those users on the system.
Exercise 1:
Write a script that creates a compressed backup of /etc
named /backup/etc-YYYYMMDD.tar.gz
, where YYYYMMDD
is the current date. The script should verify the backup and log success/failure to /var/log/backup.log
.
Exercise 2:
Write a script that reads a list of usernames from /tmp/newusers.txt
, creates each user, sets a random password.
Day 19: Host Security
Highlights
- Understanding and managing SUID, SGID, and sticky bits for file security.
- Using PAM (Pluggable Authentication Modules) to enforce security policies and resource limits.
- Monitoring user activity and logins.
- Network security: scanning for open ports, managing firewall rules, and restricting services.
- Using
sudo
for controlled privilege escalation. - Securing data with encryption and best practices for host hardening.
Key Concepts
- SUID/SGID/Sticky Bit:
- SUID (Set User ID): Executes a file with the permissions of the file owner.
- SGID (Set Group ID): Executes a file with the permissions of the file group.
- Sticky Bit: On directories, only the file owner or root can delete files.
- PAM & Limits:
/etc/security/limits.conf
for resource limits (max processes, memory, etc.).- PAM modules control authentication, password policies, and session restrictions.
- User Activity Monitoring:
who
,w
,last
,lastlog
for login tracking./var/log/wtmp
,/var/log/btmp
for successful/failed logins.
- Network Security:
nmap
,netstat
,ss
,lsof
for port and service auditing.- Firewalls:
iptables
,firewalld
,ufw
.
- Privilege Escalation:
sudo
configuration in/etc/sudoers
for least-privilege access.
- Encryption:
- Using
gpg
,openssl
, or filesystem-level encryption (e.g., LUKS) to protect data at rest.
- Using
- Host Hardening:
- Disabling unnecessary services, regular patching, enforcing strong passwords, and monitoring logs.
Exercise 1:
Install nmap
and scan your system for open ports.
Check which services are listening and restrict unnecessary ones.
Exercise 2:
Configure sudo
to allow a specific user to run only certain administrative commands.
Test and document the configuration.
Day 20: Review & Exam
Choose the best answer(s) for each question. Some questions may have more than one correct answer. Answers are provided at the end.
1. Which device file could be a serial device?
A) /dev/ttyS0
B) /dev/ttys0
C) /dev/ttySa
D) /dev/ttysa
2. What are common IRQs for serial ports? (Select all that apply.)
A) 1
B) 3
C) 4
D) 16
3. Which files contain essential system information such as IRQs, DMA channels and I/O addresses? (Select all that apply.)
A) /proc/ioports
B) /proc/ioaddresses
C) /proc/dma
D) /proc/interrupts
4. What would be the equivalent RS-232 serial device filename for what Windows would refer to as COM1?
A) /dev/ttyS0
B) /dev/ttyS1
C) /dev/lp0
D) /dev/lp1
5. Typing fdisk -l /dev/hda
on an x86 Linux computer produces a listing of four partitions: /dev/hda1, /dev/hda2, /dev/hda5, and /dev/hda6. Which of the following is true?
A) The disk contains two primary partitions and two extended partitions.
B) Either /dev/hda1 or /dev/hda2 is an extended partition.
C) The partition table is corrupted; there should be a /dev/hda3 and a /dev/hda4 before /dev/hda5.
D) If you add a /dev/hda3 with fdisk, /dev/hda5 will become /dev/hda6 and /dev/hda6 will become /dev/hda7.
6. Which of the following directories is most likely to be placed on its own hard disk partition?
A) /bin
B) /sbin
C) /mnt
D) /home
7. What does the following command accomplish?mkfs -t ext2 /dev/sda4
A) It sets the partition table type code for /dev/sda4 to ext2.
B) It converts a FAT partition into an ext2fs partition without damaging the partition’s existing files.
C) It creates a new ext2 filesystem on /dev/sda4, overwriting any existing filesystem and data.
D) Nothing; the -t option isn’t valid, and so it causes mkfs to abort its operation.
8. What mount point should you associate with swap partitions?
A) /
B) /swap
C) /boot
D) None
9. Which is the command to create a “swap” partition?
A) swapon
B) mkswap
C) top
D) swapoff
10. What does the following command accomplish?$ wc report.txt | tee wc
A) It launches the wc editor on both the report.txt and wc.txt files; each file opens in its own window.
B) It displays a count of the windows in which the report.txt file is displayed and shows that information in a new window called wc.
C) It creates a count of newlines, words, and bytes in the report.txt file and then displays a count of these statistics about the report it just generated.
D) It cleans up any memory leaks associated with the tee program’s use of the report.txt file.
E) It displays a count of newlines, words, and bytes in the report.txt file and copies that output to the wc file.
11. Which of the following are journaling filesystems for Linux? (Select three.)
A) FAT
B) ReiserFS
C) Ext2fs
D) Ext3fs
E) XFS
12. You want to run a lengthy scientific simulation program, called studentprogram, which doesn’t require any user interaction; the program operates solely on disk files. If you don’t want to tie up the shell from which you run the program, what should you type to run studentprogram in the background?
A) start studentprogram
B) studentprogram &
C) bg studentprogram
D) background studentprogram
E) nice studentprogram
13. Which of the following commands will install an RPM package file called theprogram-1.2.3-4.i386.rpm on a computer? (Select all that apply.)
A) rpm -Uvh theprogram-1.2.3-4.i386.rpm
B) rpm -i theprogram-1.2.3-4.i386.rpm
C) rpm -U theprogram
D) rpm -e theprogram-1.2.3-4.i386.rpm
E) rpm -Vp theprogram-1.2.3-4.i386.rpm
14. Which of the following, when typed in Vi’s command mode, saves a file and quits the program? (Select two.)
A) :rq
B) :wq
C) :re
D) :we
E) ZZ
15. Which of the following commands displays help on topic, when typed in a Linux shell? (Select two.)
A) manual topic
B) man topic
C) ? topic
D) info topic
E) hint topic
16. What program would you use to display the end of a configuration file?
A) uniq
B) cut
C) tail
D) wc
E) fmt
17. A text-mode program, verbose, prints a lot of spurious “error” messages to standard error. How might you get rid of those messages while still interacting with the program?
A) verbose | quiet
B) verbose &> /dev/null
C) verbose 2> /dev/null
D) verbose > junk.txt
E) quiet-mode verbose
18. Where might the BIOS find a boot loader?
A) RAM
B) /dev/boot
C) MBR
D) /dev/kmem
E) The swap partition
19. Which command would you use to list all open TCP ports and their associated processes?
A) netstat -tulnp
B) lsof -iTCP -sTCP:LISTEN
C) ss -tulnp
D) ps aux | grep tcp
E) ip addr show
20. You want to allow user alice
to run only the systemctl restart httpd
command as root via sudo. Which line should you add to /etc/sudoers
?
A) alice ALL=(ALL) ALL
B) alice ALL=(root) /usr/bin/systemctl restart httpd
C) alice ALL=(root) /usr/bin/systemctl
D) alice ALL=(ALL) NOPASSWD: ALL
E) alice ALL=(root) /usr/bin/httpd
Answers
- A
- B, C
- A, C, D
- A
- B
- D
- C
- D
- B
- E
- B, D, E
- B
- A, B
- B, E
- B, D
- C