LFCS Sample Practice Questions¶
Practice Resources¶
Section 1: Essential Commands (25%)¶
Question 1.1¶
Find all files in /var larger than 50MB and list them with their sizes.
Question 1.2¶
Replace all occurrences of "error" with "warning" in /var/log/app.log without creating a backup.
Question 1.3¶
Create a compressed tar archive of /etc named etc-backup.tar.gz.
Question 1.4¶
Set permissions on /data directory so owner has full access, group has read/execute, others have no access. Apply recursively.
Section 2: Operation of Running Systems (20%)¶
Question 2.1¶
List all running services and their status.
Question 2.2¶
Configure the nginx service to start automatically at boot.
Question 2.3¶
Find the process using the most CPU and kill it.
Show Solution
Question 2.4¶
Schedule a script /opt/backup.sh to run every day at 2:30 AM.
Section 3: User and Group Management (10%)¶
Question 3.1¶
Create a user "developer" with home directory /home/developer and shell /bin/bash.
Question 3.2¶
Add user "developer" to the "docker" group as a secondary group.
Question 3.3¶
Set password expiry for user "developer" to 90 days.
Section 4: Networking (12%)¶
Question 4.1¶
Display all network interfaces and their IP addresses.
Question 4.2¶
Add a static route to network 10.0.0.0/24 via gateway 192.168.1.1.
Question 4.3¶
Open port 8080/tcp in the firewall permanently.
Show Solution
Question 4.4¶
Configure the system to use DNS server 8.8.8.8.
Show Solution
Section 5: Service Configuration (20%)¶
Question 5.1¶
Configure SSH to disable root login.
Show Solution
Question 5.2¶
Configure NTP to sync time with pool.ntp.org.
Show Solution
Question 5.3¶
Set up a basic Apache virtual host for domain example.com serving content from /var/www/example.
Show Solution
# Create /etc/apache2/sites-available/example.com.conf (Ubuntu)
# Or /etc/httpd/conf.d/example.com.conf (RHEL)
cat << EOF > /etc/apache2/sites-available/example.com.conf
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example
<Directory /var/www/example>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EOF
a2ensite example.com.conf
systemctl reload apache2
Section 6: Storage Management (13%)¶
Question 6.1¶
Create a new partition on /dev/sdb using all available space.
Show Solution
Question 6.2¶
Create an ext4 filesystem on /dev/sdb1 and mount it at /data.
Show Solution
Question 6.3¶
Create an LVM logical volume named "data" of 10GB from volume group "vg01".
Question 6.4¶
Extend logical volume /dev/vg01/data by 5GB and resize the filesystem.
Show Solution
Quick Reference Commands¶
# System info
uname -a
hostnamectl
cat /etc/os-release
# Disk usage
df -h
du -sh /path
# Memory
free -h
# Processes
ps aux
top
htop
# Services
systemctl status service
systemctl start/stop/restart service
systemctl enable/disable service
# Logs
journalctl -u service
tail -f /var/log/syslog
# Network
ip addr
ip route
ss -tulpn
netstat -tulpn
Exam Tips¶
- Know your editor: vim or nano - be fast
- Use tab completion: Save time and avoid typos
- Check man pages:
man commandis your friend - Verify your work: Always check if changes took effect
- Time management: Don't spend too long on one question
- Read carefully: Understand what's being asked