CompTIA Linux+ flashcards
CompTIA Linux+ · Build recall with a focused review session.
32 cards. Read the term and the definition here. The deck at the top of this page is optional.
- uname -r
- Displays the running Linux kernel release number; use uname -a for all system information including kernel name, hostname, and architecture.
- lsblk -f
- Lists block devices with filesystem type, label, UUID, and mount point; useful for identifying disks before editing /etc/fstab or creating filesystems.
- df -h
- df -h reports free and used space per mounted filesystem; du -sh summarizes disk usage of a directory tree in human-readable units.
- LVM volume extension
- After lvextend enlarges a logical volume, resize the filesystem with resize2fs for ext4 or xfs_growfs for XFS; XFS cannot shrink.
- fstab fields
- The six fields are device or UUID, mount point, filesystem type, mount options, dump flag, and fsck pass number; UUIDs avoid device-name changes.
- systemctl daemon-reload
- Reloads systemd manager configuration after unit files change; it does not restart services, so restart the affected unit separately when needed.
- tar -xzf
- Extracts a gzip-compressed tar archive; -x extracts, -z filters through gzip, and -f specifies the archive filename.
- systemctl enable
- Configures a systemd unit to start automatically at boot by creating the appropriate symlinks; it does not start the unit immediately.
- systemctl mask
- Links a unit to /dev/null so it cannot be started manually or as a dependency; unmask removes the link and restores normal control.
- systemctl get-default
- Prints the default systemd target, such as multi-user.target or graphical.target, which determines the runlevel-like state reached at boot.
- useradd -m
- Creates a new user and home directory; common options include -s for login shell and -G for supplementary groups.
- /etc/shadow
- Stores hashed user passwords and aging data; readable only by root; fields include login name, hash, last change, minimum, maximum, warning, inactive, and expiry.
- usermod -aG
- Adds a user to supplementary groups while preserving existing memberships; omitting -a replaces the user's supplementary group list.
- crontab -e
- Edits the current user's cron table; each job has five time fields followed by the command, and /etc/crontab includes an extra user field.
- chmod 750
- Sets owner read-write-execute, group read-execute, and others no access; numeric values are 4 read, 2 write, 1 execute.
- umask 027
- Masks permissions so new files get 640 and new directories get 750 by subtracting from default 666 and 777; restricts group write and all other access.
- setuid bit
- A setuid executable runs with the file owner's effective user ID; find / -perm -4000 locates setuid files, which should be audited for security.
- SELinux modes
- Enforcing blocks and logs policy violations; permissive logs but allows; disabled turns SELinux off; getenforce displays the current mode.
- restorecon
- Restores SELinux file contexts according to policy; use after copying files or changing fcontext rules because copied files may retain wrong labels.
- ssh-keygen -t ed25519
- Generates an SSH key pair using the Ed25519 algorithm; the public key is placed in ~/.ssh/authorized_keys on the target server.
- visudo
- Safely edits /etc/sudoers with syntax checking; a rule like %wheel ALL=(ALL) ALL grants all members of wheel sudo privileges.
- shebang
- The first line of a script, such as #!/bin/bash, tells the kernel which interpreter to use when the script is executed.
- set -e
- Causes a shell script to exit immediately when a command returns a non-zero status; combine with set -u to catch unset variables.
- $?
- Holds the exit status of the most recently executed command; zero means success and non-zero indicates failure in shell scripts.
- [[ ]]
- Bash conditional construct supporting pattern matching and safer string tests; use -eq for numeric comparison and = for string equality.
- Ansible playbook
- A YAML file defining idempotent tasks for hosts; run it with ansible-playbook -i inventory site.yml, and modules report changed or ok states.
- sed -i
- Edits files in place using a stream editing expression; s/old/new/g replaces all occurrences on each matching line.
- journalctl -u
- Displays journal entries for a specific systemd unit; combine with -f to follow logs or --since to limit the time range.
- ip route
- Displays the kernel routing table; ip route add default via GATEWAY sets the default route, and ip addr shows interface addresses.
- lsof +L1
- Lists open files with a link count below one, which often identifies deleted files still consuming disk space until their processes exit.
- fsck
- Checks and repairs a filesystem; it must be run on an unmounted filesystem or at boot, because running it on a mounted filesystem can cause corruption.
- strace
- Traces system calls and signals made by a process; useful to diagnose missing files, permission errors, and library or configuration failures.