Missing Cs Semester

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/500

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:16 PM on 9/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

501 Terms

1
New cards
What is a shell?
A textual interface and command interpreter that lets you run programs, give them input, inspect output, and automate tasks.
2
New cards
What is a terminal?
The visual program that provides an interface where a shell runs.
3
New cards
What is Bash?
The Bourne Again Shell, a widely used Unix shell and scripting language.
4
New cards
Why is the shell useful?
It is fast, composable, scriptable, and lets you combine programs to automate tasks that may be awkward in graphical interfaces.
5
New cards
What is a shell prompt?
The place in a terminal where the shell waits for you to enter a command.
6
New cards
What is a command-line argument?
A string passed to a program when it is executed.
7
New cards
How does the shell normally split a command into a program and arguments?
It splits on whitespace unless characters are quoted or escaped.
8
New cards
How do you pass an argument containing spaces to a shell command?
Quote it with single or double quotes, or escape the spaces with backslashes.
9
New cards
What does man do?
Displays the manual page for a command.
10
New cards
What is tldr useful for?
Showing concise, example-focused help for common command usage.
11
New cards
What does cd do?
Changes the shell's current working directory.
12
New cards
Why must cd be a shell built-in rather than a normal child process?
A child process cannot change the working directory of its parent shell.
13
New cards
What does pwd do?
Prints the current working directory.
14
New cards
What does $PWD contain?
The path of the current working directory.
15
New cards
What is an absolute path?
A path that starts at the filesystem root / and does not depend on the current directory.
16
New cards
What is a relative path?
A path interpreted relative to the current working directory.
17
New cards
What does . mean in a filesystem path?
The current directory.
18
New cards
What does .. mean in a filesystem path?
The parent directory.
19
New cards
What does ~ usually represent in the shell?
The current user's home directory.
20
New cards
What does pressing Tab commonly do in a shell?
Autocompletes commands, filenames, or paths when possible.
21
New cards
What is $PATH?
An environment variable listing directories the shell searches for executable programs.
22
New cards
What does which command do?
Shows the executable path that would be used for a command name.
23
New cards
How can you bypass $PATH when running a program?
Invoke the executable using an explicit path such as /bin/echo or ./program.
24
New cards
What does ls do?
Lists directory contents.
25
New cards
What does cat file do?
Prints the contents of a file.
26
New cards
What does sort file do?
Outputs the file's lines in sorted order.
27
New cards
What does uniq do?
Removes adjacent duplicate lines, so input is commonly sorted first.
28
New cards
What do head and tail do?
Print the first or last portion of input or a file.
29
New cards
What does grep pattern file do?
Prints lines that match the given pattern, which may be a regular expression.
30
New cards
How do you recursively search files with grep?
Use grep -r with a directory or search path.
31
New cards
What is ripgrep (rg)?
A fast, user-friendly recursive search tool commonly used as an alternative to grep.
32
New cards
What is sed primarily used for?
Programmatic text transformation and editing.
33
New cards
What does sed -i 's/pattern/replacement/g' file do?
Replaces all matches of pattern with replacement in the file in place.
34
New cards
What is find used for?
Recursively finding filesystem entries that match conditions such as name, type, size, or modification time.
35
New cards
What does find ~/Downloads -type f -name '*.zip' -mtime +30 find?
Regular files ending in .zip under Downloads that are older than 30 days.
36
New cards
What does {} represent in find -exec?
The pathname of the current matching file.
37
New cards
What is fd?
A more user-friendly alternative to find, though generally less portable.
38
New cards
What is awk especially useful for?
Parsing and processing structured line-oriented text, especially fields or columns.
39
New cards
What does awk '{print $2}' file do?
Prints the second whitespace-separated field from each line.
40
New cards
What does the pipe operator | do?
Connects the stdout of the command on the left to the stdin of the command on the right.
41
New cards
What does > do in the shell?
Redirects stdout to a file, overwriting the file.
42
New cards
What does >> do in the shell?
Redirects stdout to a file by appending.
43
New cards
What does < do in the shell?
Redirects a file into a command's stdin.
44
New cards
What does tee do?
Copies stdin to stdout while also writing it to a file.
45
New cards
What is command substitution?
Running a command and substituting its stdout into the surrounding shell expression using $(command).
46
New cards
Why is $(command) preferred over backticks?
It is clearer and can be nested more easily.
47
New cards
What does a shebang such as #!/bin/bash do?
Specifies the interpreter that should execute the script.
48
New cards
What does set -e do in a Bash script?
Causes the script to exit early when a command fails in applicable contexts.
49
New cards
What does set -u do in a Bash script?
Treats use of an unset variable as an error.
50
New cards
What does set -o pipefail do?
Makes a pipeline fail if any command in the pipeline fails rather than only considering the last command.
51
New cards
In a shell script, what does $0 contain?
The name or path used to invoke the script.
52
New cards
In a shell script, what does $1 contain?
The first positional argument.
53
New cards
What does $@ represent in a shell script?
All positional arguments.
54
New cards
What does $# represent in a shell script?
The number of positional arguments.
55
New cards
What is a CLI flag?
An usually optional argument, commonly beginning with - or --, that modifies program behavior.
56
New cards
What is the common difference between -a and --all style flags?
-a is a short flag and --all is a long flag; programs often provide both for the same option.
57
New cards
What does combining short flags such as -la usually mean?
It is shorthand for separate short flags such as -l -a when the program supports grouping.
58
New cards
What does -- commonly mean when parsing CLI arguments?
Stop parsing options; treat everything after it as positional arguments.
59
New cards
What is globbing?
Shell expansion of wildcard patterns into matching pathnames before the program is executed.
60
New cards
What does * match in a shell glob?
Zero or more characters.
61
New cards
What does ? match in a shell glob?
Exactly one character.
62
New cards
What does {a,b,c} do in shell brace expansion?
Expands into separate alternatives: a, b, and c.
63
New cards
What happens before rm *.py is executed?
The shell expands *.py to matching filenames and passes those filenames as arguments to rm.
64
New cards
What can ** represent in shells such as Zsh when recursive globbing is enabled?
Paths across directory levels, enabling recursive matching.
65
New cards
Do commands in a pipeline normally wait for the previous command to finish before starting?
No. The shell starts the pipeline processes concurrently and connects their streams.
66
New cards
What is stdin?
Standard input, stream number 0, used by a program to receive input.
67
New cards
What is stdout?
Standard output, stream number 1, used for normal program output and pipelines.
68
New cards
What is stderr?
Standard error, stream number 2, used for warnings and errors separately from normal output.
69
New cards
Why is stderr separate from stdout?
So diagnostic messages do not accidentally become data consumed by the next command in a pipeline.
70
New cards
What does 2> errors.txt do?
Redirects stderr to errors.txt.
71
New cards
What does &> output.txt do in Bash?
Redirects both stdout and stderr to the same file.
72
New cards
What does /dev/null do when used as a redirection target?
Discards the data written to it.
73
New cards
What does cmd > /dev/null 2>&1 do?
Discards both stdout and stderr.
74
New cards
What is fzf?
An interactive fuzzy finder that reads candidate lines from stdin and lets you filter and select one.
75
New cards
What is the correct Bash variable assignment syntax?
name=value with no spaces around =.
76
New cards
Why is foo = bar not a Bash variable assignment?
Whitespace causes argument splitting, so the shell interprets it as running command foo with arguments = and bar.
77
New cards
What type are ordinary shell variables conceptually?
Strings.
78
New cards
How do single and double quotes differ in Bash?
Single quotes keep contents literal; double quotes allow expansions such as variables and command substitution.
79
New cards
What does files=$(ls) do?
Stores the stdout of ls in the shell variable files.
80
New cards
What is process substitution?
Using syntax such as <(command) to expose a command's output through a temporary file-like pathname.
81
New cards
When is process substitution useful?
When a command expects filename arguments rather than stdin, such as diff <(cmd1) <(cmd2).
82
New cards
What does printenv show?
Environment variables available to the process.
83
New cards
What is the difference between a shell variable and an exported environment variable?
A shell variable exists in the current shell; an exported variable is also inherited by child processes.
84
New cards
What does TZ=Asia/Tokyo date do?
Runs date with TZ set only in that command's environment.
85
New cards
What does export DEBUG=1 do?
Sets DEBUG in the current shell and marks it for inheritance by child processes.
86
New cards
What does unset DEBUG do?
Removes the variable DEBUG from the current shell environment.
87
New cards
What does exit code 0 conventionally mean?
Success.
88
New cards
What does a nonzero exit code conventionally mean?
Failure or some exceptional condition.
89
New cards
What does $? contain?
The exit status of the most recently executed command.
90
New cards
What does command1 && command2 mean?
Run command2 only if command1 succeeds.
91
New cards
What does command1 || command2 mean?
Run command2 only if command1 fails.
92
New cards
How do Bash if and while conditions determine true or false?
They use the exit status of the condition command; 0 is treated as true/success.
93
New cards
What signal is normally sent when you press Ctrl-C?
SIGINT.
94
New cards
What does Ctrl-Z normally do to the foreground job?
Sends SIGTSTP, suspending the job.
95
New cards
What is SIGTERM intended for?
Requesting that a process terminate gracefully.
96
New cards
Why is SIGKILL special?
It cannot be caught or ignored and immediately terminates the process.
97
New cards
What does fg do?
Resumes a suspended/background job in the foreground.
98
New cards
What does bg do?
Resumes a suspended job in the background.
99
New cards
What does jobs do?
Lists unfinished jobs associated with the current shell session.
100
New cards
What does placing & after a command do?
Starts the command as a background job and returns the shell prompt.