Study guide · Flashcards & memory notes

Linux CLI Flashcards & Memory Notes

40 recall cards for the facts everyday Linux work depends on: paths, pipes, permission math, sudo versus su, package managers, systemd, and disk checks. Study one card at a time or browse every answer below.

Subject path · everyday GNU/Linux4 decks · 40 cardsNo sign-up required

How to use these cards: Say the answer out loud before you flip the card, and mark it honestly. Revisit the cards you missed tomorrow rather than rereading them right away. Progress is kept only while this page is open. For the full explanations behind each card, see the core notes.

Study mode

Choose a deck, flip each card, and mark what you already know.

All flashcards

Select a question to reveal its answer.

Deck 1 · Shell, paths, and navigation

Where you are, how PATH works, and which directory a token means.

10 cards
1.1Which command prints the absolute path of the current working directory?

pwd. ls lists files, and cd changes directory.

Memory note: Print Working Directory.

1.2In a Linux path, what does the tilde (~) stand for?

The current user's home directory, such as /home/ada.

Memory note: Root's home is /root, not under /home.

1.3What is the difference between . and .. in a path?

. is the current directory. .. is the parent of the current directory.

1.4What does the PATH variable contain?

A colon-separated list of directories the shell searches for commands.

Memory note: Check it with echo $PATH.

1.5Why do you usually run ./script.sh instead of script.sh?

The current directory is usually not on PATH, so the shell will not find a local script by name alone.

1.6Which command opens the full manual page for ls?

man ls

1.7What does cd with no arguments do?

It changes to the current user's home directory.

1.8What does cd - do?

It returns to the previous working directory.

1.9What belongs in /etc?

System configuration files, such as passwd, fstab, hosts, and service settings.

1.10What is the difference between which and type?

which prints the first executable on PATH. type also reports whether the name is a builtin, alias, or function.

Deck 2 · Files, text, and I/O

Copy, search, page through logs, and connect commands.

10 cards
2.1Which cp flag is required to copy a directory tree?

-r (recursive). Without it, cp refuses to copy a directory.

2.2What is the difference between mv and cp?

mv moves or renames a path. cp copies and leaves the original in place.

2.3What does grep -v do?

It inverts the match and prints lines that do not contain the pattern.

2.4What is the difference between > and >>?

> writes standard output to a file and replaces the file if it exists. >> appends.

2.5What does a pipe (|) do?

It sends the standard output of the left command to the standard input of the right command.

Memory note: A pipe does not change the original file unless a later command writes back to it.

2.6Which command pages through a long file without dumping it all at once?

less. cat prints the whole file; head and tail show only the ends.

2.7What does find /var -name '*.log' do?

It walks /var and lists files whose names match *.log. Quote the pattern so the shell does not expand it first.

2.8What is the difference between ln and ln -s?

ln creates a hard link. ln -s creates a symbolic link that points at another path.

2.9How do you create a gzip-compressed tar archive of dir/?

tar -czf archive.tar.gz dir/

Memory note: Extract with tar -xzf archive.tar.gz.

2.10What does tail -f do?

It follows a file and prints new lines as they are written, which is useful for live logs.

Deck 3 · Permissions, users, and processes

Mode bits, privilege, account files, and signals.

10 cards
3.1In chmod octal math, what do 4, 2, and 1 mean?

Read = 4, write = 2, execute = 1. Add them for owner, group, and others.

3.2Which Linux command changes file permissions, and what does 755 mean?

chmod. In 755:

  • 7 for the owner: read + write + execute (4 + 2 + 1)
  • 5 for the group: read + execute (4 + 1)
  • 5 for others: read + execute (4 + 1)

Memory note: This wording matches the CompTIA A+ Linux permission card so the two topics stay consistent.

3.3What is a typical mode for a regular file that others may read but not write?

644 (rw-r--r--).

3.4What is the difference between sudo and su?

sudo runs a single command with root privileges, using your own password and the permissions in the sudoers file. su switches to another user account, root by default, and requires that account's password.

3.5Which file stores password hashes, and who can read it?

/etc/shadow. Only root can read it.

3.6Which file stores account names, UIDs, home directories, and login shells?

/etc/passwd. It is world-readable and does not store password hashes.

3.7What does chown ada:staff report.txt do?

It sets the owner to ada and the group to staff. You usually need sudo.

3.8What is the difference between kill PID and kill -9 PID?

kill sends SIGTERM (15) and asks the process to exit. kill -9 sends SIGKILL, which cannot be caught. Try SIGTERM first.

3.9Which command shows a live view of CPU and memory use?

top. ps aux is a one-time snapshot.

3.10What does execute permission mean on a directory?

You can enter the directory with cd and traverse it. Without execute, you cannot use that path even if you can read the listing.

Deck 4 · Packages, services, networking, and disks

Install software, start services, test the network, and find space problems.

10 cards
4.1What is the difference between apt update and apt upgrade?

apt update refreshes the package index. apt upgrade installs newer versions of packages already on the system.

4.2Which package manager is used on Fedora and RHEL-family systems?

dnf. Debian and Ubuntu use apt.

4.3What does systemctl enable do?

It configures the service to start automatically at boot. start runs it now; enable is about the next boot.

4.4Which command shows logs for one systemd unit?

journalctl -u name

4.5Which modern commands replace ifconfig and netstat?

ip replaces ifconfig. ss replaces netstat. ifconfig and netstat are Extra legacy tools.

4.6What is the difference between df -h and du -sh?

df -h shows free space per mounted file system. du -sh shows the disk usage of one path.

4.7When is it safe to run fsck?

Only when the file system is unmounted, or from rescue media. Running fsck on a mounted file system can cause damage.

4.8What is /etc/fstab for?

It lists file systems that should be mounted at boot.

4.9What does ss -tulpn show?

Listening TCP and UDP sockets and the processes that own them.

4.10What does command not found usually mean?

The program is not installed, or its directory is not on PATH. It is not the same as permission denied.

Memory notes

Groupings and patterns that make the most-used facts easier to recall.

Path tokens

  • / root of the tree
  • . here, .. up one
  • ~ home, cd - previous directory

Linux permission math

Read = 4, Write = 2, Execute = 1. Add them for owner, group, and others.

  • 755: rwx r-x r-x (typical for programs and directories)
  • 644: rw- r-- r-- (typical for regular files)
  • 700: rwx --- --- (private to the owner)

sudo vs. su

sudo = one command, your password, sudoers. su = switch user, their password. Prefer sudo on desktops where the root password is not set.

Five files in /etc

  • passwd accounts · shadow hashes
  • hosts local names · resolv.conf DNS
  • fstab mounts at boot

Redirection

  • > replace · >> append · 2> errors
  • | to another command · && only if success

Read the error

command not found → PATH or missing package. Permission denied → mode or owner. No space left → df -h and df -i.

Continue the Linux CLI study path

Test what you have learned with a timed practice exam.

Linux CLI hub →
Available

Overview

Scope, domains, command map, file-system layout, and a study plan for everyday Linux CLI.

Available

Core Notes

Technical reference notes for the shell, files, permissions, packages, services, and networking.

Available · You are here

Flashcards & Memory Notes

40 recall cards in four decks, plus memory notes for commands and paths.

Available

Practice Exams

200 original questions with custom exams, explanations, and a score report by domain.

Related Tools

Useful companions while you study.

All study topics →