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
What is the purpose of the 'tee' command in a pipeline?
Answer: Writes output to both a file and stdout simultaneously
tee reads from stdin and writes to both stdout and one or more files at the same time.
Which command displays the inode number of a file?
Answer: ls -i filename
ls -i displays the inode number for each listed file.
A user runs 'ps aux | grep nginx'. What does the 'x' flag in 'aux' do?
Answer: Shows processes without a controlling terminal
The x flag shows processes not attached to a terminal, including daemons like nginx.
Which command replaces every occurrence of 'foo' with 'bar' in a file using sed?
Answer: sed 's/foo/bar/g' file.txt
The g flag at the end of the sed substitution command applies the replacement globally on each line.
What does 'xargs' primarily do when used in a pipeline?
Answer: Converts stdin lines into command-line arguments
xargs reads items from stdin and passes them as arguments to a specified command.
Which command shows real-time system resource usage updated every second?
Answer: top
top provides an interactive real-time view of running processes and system resource usage.
What does the command 'cut -d: -f1 /etc/passwd' extract?
Answer: The username field from each line
cut -d: uses colon as delimiter and -f1 selects the first field, which is the username in /etc/passwd.