Master Linux Administration with 50 free flashcards. Study using spaced repetition and focus mode for effective learning in Programming.
The ls command lists directory contents. Common flags:-l long format with permissions, owner, size, date-a show hidden files (dotfiles)-h human-readable sizes-R recursive listing-t sort by modification time
grep searches text using patterns.
Usage: grep [options] pattern [file...]
Key flags:-i case-insensitive-r recursive search-n show line numbers-v invert match-E extended regex (same as egrep)
find searches the directory tree.
Examples:find /home -name "*.txt" — find by namefind . -type f -mtime -7 — files modified in last 7 daysfind / -size +100M — files larger than 100MBfind . -perm 755 — find by permissionsfind . -name "*.log" -exec rm {} \; — execute command on results
awk is a powerful text-processing language that operates on fields and records.
Examples:awk '{print $1, $3}' file — print columns 1 and 3awk -F: '{print $1}' /etc/passwd — set delimiter to colonawk '$3 > 100 {print $0}' data.txt — conditional filtering
Built-in variables: NR (record number), NF (number of fields), FS (field separator)
sed (stream editor) transforms text in a pipeline.
Common usage:sed 's/old/new/' file — replace first occurrence per linesed 's/old/new/g' file — replace all occurrencessed -i 's/old/new/g' file — edit file in-placesed -n '5,10p' file — print lines 5–10sed '/pattern/d' file — delete matching lines
Key directories:/etc — system configuration files/var — variable data (logs, spools, caches)/home — user home directories/usr — user programs and read-only data/tmp — temporary files (cleared on reboot)/proc — virtual filesystem for process/kernel info/dev — device files (block and character devices)
/proc is a virtual filesystem that provides an interface to kernel data structures.
Key entries:/proc/cpuinfo — CPU details/proc/meminfo — memory usage/proc/[PID]/ — per-process info/proc/loadavg — system load averages/proc/filesystems — supported filesystemsIt exists only in memory, not on disk.
Permissions have three sets: owner, group, others, each with r(4), w(2), x(1).
Numeric: chmod 755 file → rwxr-xr-x
Symbolic: chmod u+x file → add execute for ownerchmod g-w file → remove write for groupchmod o=r file → set others to read onlychmod -R 644 dir/ → recursive
Special permission bits:SUID (4xxx) — file executes as the file owner. Example: chmod 4755 file. Shown as -rwsr-xr-xSGID (2xxx) — file executes as the group owner; on directories, new files inherit the group. chmod 2755 dirSticky bit (1xxx) — only file owner can delete files in the directory. chmod 1777 /tmp. Shown as drwxrwxrwt
umask sets the default permission mask for newly created files and directories.
It subtracts permissions from the maximum (666 for files, 777 for dirs).
Example: umask 022 → new files get 644, new dirs get 755umask 077 → new files get 600, new dirs get 700
View current: umask or umask -S (symbolic)
Set in ~/.bashrc or /etc/profile for persistence.
chown changes file owner and/or group:chown user file — change ownerchown user:group file — change bothchown :group file — change group onlychown -R user:group dir/ — recursivechgrp changes group only:chgrp developers file
Only root can change file ownership; group members can use chgrp.
ps shows a snapshot of processes:ps aux — all processes, detailedps -ef — full-format listingps -u username — processes by usertop shows a real-time dynamic view:k — kill a processM — sort by memoryP — sort by CPUq — quithtop is an enhanced interactive alternative.
Flashcards
Flip to reveal
Focus Mode
Spaced repetition
Multiple Choice
Test your knowledge
Type Answer
Active recall
Learn Mode
Multi-round mastery
Match Game
Memory challenge