CompTIA Linux+ Linux GNU and Unix Commands Flashcards
7 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 CompTIA Linux+ Linux GNU and Unix Commands flashcards as text
Which command sends a SIGKILL signal to a process with PID 1234?
Answer: kill -9 1234
Signal 9 (SIGKILL) forcefully terminates a process immediately without cleanup.
A script needs to run in the background and survive after logout. Which command achieves this?
Answer: nohup ./script.sh &
nohup prevents the process from receiving SIGHUP on logout; & puts it in the background.
What is the result of running 'mkdir -p /tmp/a/b/c'?
Answer: Creates /tmp/a, /tmp/a/b, and /tmp/a/b/c even if intermediate dirs don't exist
mkdir -p creates all intermediate directories in the path without error if they already exist.
Which command shows the full path of an executable named 'python3'?
Answer: which python3
which searches the PATH environment variable and returns the full path of the named executable.
A user types 'history | tail -5'. What is displayed?
Answer: The last 5 commands entered in the shell
history outputs all previous commands; piping through tail -5 shows only the last 5 entries.
What does the 'awk '{print $3}'' command extract from its input?
Answer: The third whitespace-delimited field from each line
In awk, $1, $2, $3 refer to fields split by whitespace; $3 prints the third field of each line.
Which command archives and compresses a directory 'project/' into 'project.tar.gz'?
Answer: tar -czf project.tar.gz project/
tar -czf creates (-c) an archive, compresses with gzip (-z), and writes to the named file (-f).