Skip to content

Lpic Lfcs

← Back to all decks

26 cards — 🟢 6 easy | 🟡 12 medium | 🔴 2 hard

🟢 Easy (6)

1. What are the LFCS exam domains and their weights?

Show answer Essential Commands: 25%
Operation of Running Systems: 20%
User and Group Management: 15%
Networking: 15%
Storage Management: 15%
Service Configuration: 10%

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

2. What are the common I/O redirection operators in bash?

Show answer > stdout to file (overwrite)
>> stdout to file (append)
2> stderr to file
&> stdout + stderr to file
| pipe stdout to next command
< stdin from file
2>&1 redirect stderr to stdout

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

3. How do you create and manage users on Linux?

Show answer Create: useradd -m -s /bin/bash -G sudo alice
System account: useradd -r -s /sbin/nologin serviceuser
Add to group: usermod -aG docker alice
Lock: usermod -L alice
Delete: userdel -r alice (removes home dir)
Password aging: chage -M 90 alice (max 90 days)

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

4. What is the difference between LPIC-1 and LFCS certifications?

Show answer LPIC-1: LPI, distro-neutral, multiple choice + fill-in, two exams (101+102), tests both Debian and RHEL knowledge.
LFCS: Linux Foundation, hands-on performance-based, single exam, choose Ubuntu or CentOS environment. LFCS is closer to RHCSA in format.

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

5. How do you create and extract tar archives with different compression?

Show answer Create gzip: tar czf archive.tar.gz /path/
Create bzip2: tar cjf archive.tar.bz2 /path/
Extract: tar xzf archive.tar.gz or tar xjf archive.tar.bz2
Extract to dir: tar xzf archive.tar.gz -C /destination/
List contents: tar tzf archive.tar.gz

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

6. What is the crontab time format?

Show answer Five fields: minute hour day-of-month month day-of-week
Example: */5 * * * * command (every 5 minutes)
0 2 * * 0 command (Sundays at 2am)
Edit: crontab -e
List: crontab -l
Other user: sudo crontab -u alice -e

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

🟡 Medium (12)

1. How do you use find to locate files by name, size, time, and permissions?

Show answer By name: find / -name "*.conf"
By size: find / -type f -size +100M
By time: find / -type f -mtime -7 (modified in last 7 days)
By owner: find / -user alice
By permission: find / -perm -4000 (SUID files)
With action: find /tmp -name "*.tmp" -delete

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

2. What are setuid, setgid, and sticky bit?

Show answer setuid (4xxx): binary runs as file owner, not the user running it. Example: /usr/bin/passwd
setgid (2xxx): on dirs, new files inherit the group. On binaries, runs as file group.
sticky bit (1xxx): on dirs, only file owner can delete their files. Example: /tmp
Set: chmod u+s (setuid), chmod g+s (setgid), chmod +t (sticky)

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

3. How do you use POSIX ACLs for fine-grained file permissions?

Show answer Set: setfacl -m u:alice:rwx file
Set group: setfacl -m g:devs:rx directory
View: getfacl file
Remove: setfacl -x u:alice file
Remove all: setfacl -b file
ACLs shown by + in ls -l output: -rw-r--r--+

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

4. How do you manage systemd targets (runlevels)?

Show answer Check: systemctl get-default
Set: sudo systemctl set-default multi-user.target
Switch now: sudo systemctl isolate rescue.target
Common targets: graphical.target (GUI), multi-user.target (CLI), rescue.target (single-user), emergency.target
Equivalent to old runlevels 0-6.

Remember: 0=halt, 1=single, 3=multi+net, 5=GUI, 6=reboot. "0=Off, 3=Server, 5=GUI, 6=Reboot."

5. How do you use journalctl for log analysis?

Show answer By service: journalctl -u nginx
By time: journalctl --since "1 hour ago"
By priority: journalctl -p err (emerg/alert/crit/err/warning/notice/info/debug)
Current boot: journalctl -b
Previous boot: journalctl -b -1
Follow: journalctl -u nginx -f
Disk usage: journalctl --disk-usage

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

6. What is the format of /etc/fstab and how do you use it safely?

Show answer Format: device mountpoint fstype options dump pass
Example: UUID=xxx /mnt/data ext4 defaults 0 2
Always use UUID (not /dev/sdX which can change).
Test: sudo mount -a (verifies fstab without reboot).
Use nofail for non-critical mounts to prevent boot failures.
Bad fstab entry = unbootable system!

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

7. What are the essential SSH hardening settings?

Show answer PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
Config: /etc/ssh/sshd_config
Key permissions: ~/.ssh/ (700), authorized_keys (600), private key (600)
Restart: sudo systemctl restart sshd
Wrong permissions = SSH silently falls back to password auth.

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

8. How do you properly modify GRUB bootloader configuration?

Show answer Edit /etc/default/grub (NOT /boot/grub/grub.cfg directly).
Regenerate: sudo update-grub (Debian) or sudo grub2-mkconfig -o /boot/grub2/grub.cfg (RHEL).
Editing grub.cfg directly = changes overwritten on next kernel update.

Remember: Edit `/etc/default/grub` → `grub-mkconfig`. Never edit grub.cfg directly.

9. What are the key process signals and how do you send them?

Show answer SIGTERM (15): graceful termination (default kill)
SIGKILL (9): force kill (cannot be caught)
SIGHUP (1): reload config (many daemons)
SIGSTOP/SIGCONT: pause/resume
Send: kill PID, kill -9 PID, kill -HUP PID
By name: killall nginx, pkill -f "pattern"

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

10. How does Apache virtual host management work on Debian/Ubuntu?

Show answer Config: /etc/apache2/sites-available/
Enable: sudo a2ensite mysite.conf
Disable: sudo a2dissite mysite.conf
Enable module: sudo a2enmod rewrite ssl
Disable module: sudo a2dismod php
Test: sudo apache2ctl configtest
Reload: sudo systemctl reload apache2

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

11. How do you create and manage swap space on Linux?

Show answer Create swap partition: mkswap /dev/sdb2
Enable: swapon /dev/sdb2
Disable: swapoff /dev/sdb2
Check: free -h, cat /proc/swaps
Create swap file: dd if=/dev/zero of=/swapfile bs=1M count=1024 && mkswap /swapfile && swapon /swapfile
Persist in /etc/fstab: /swapfile none swap sw 0 0

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

12. How do you manage Linux kernel modules?

Show answer List loaded: lsmod
Load: sudo modprobe module_name
Unload: sudo modprobe -r module_name
Info: modinfo module_name
Auto-load at boot: /etc/modules-load.d/
Blacklist: echo "blacklist module_name" > /etc/modprobe.d/blacklist-mod.conf

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.

🔴 Hard (2)

1. What is the complete LVM workflow from physical volume to mounted filesystem?

Show answer 1. pvcreate /dev/sdb (create PV)
2. vgcreate datavg /dev/sdb (create VG)
3. lvcreate -L 5G -n datalv datavg (create LV)
4. mkfs.ext4 /dev/datavg/datalv (create filesystem)
5. mount /dev/datavg/datalv /mnt/data
6. Add to /etc/fstab with UUID
Extend: lvextend -r -L +2G /dev/datavg/datalv (-r resizes filesystem too)

Remember: LVM cmds: pv*(physical), vg*(group), lv*(logical). pvdisplay, vgextend, lvresize.

2. How do you configure iptables rules for a basic server?

Show answer Allow SSH: iptables -A INPUT -p tcp --dport 22 -j ACCEPT
Allow HTTP: iptables -A INPUT -p tcp --dport 80 -j ACCEPT
Allow established: iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Allow loopback: iptables -A INPUT -i lo -j ACCEPT
Default deny: iptables -P INPUT DROP
Persist (Debian): apt install iptables-persistent && netfilter-persistent save

Remember: LPIC/LFCS exams are hands-on. Practice on real systems, not just theory.

Gotcha: Know default file paths and command flags for the exam.