010-160 · domain
The Power OF The Command Line
This domain covers working at the Linux shell: running commands, chaining them with pipes and operators, and filtering output. LPI tests it through practical scenarios using ls, grep, find, redirection, and exit-status logic, so you must read a described goal and pick the command or operator that actually produces it.
Focused practice
Practice The Power OF The Command Line questions
Scored sessions drawing only from this domain — pick a length below.
Start 20-question practice test →What this domain covers
What to know about The Power OF The Command Line
You must be able to build a working command line: pipe output through grep, use find with time and size filters, redirect results to a file, and choose && versus ; based on exit status. Getting the operator and redirection right is the single most important thing.
Using pipes to send output between commands such as ls and grep
Filtering and searching file contents with grep, including line-number output
Locating files by size, modification time, and path using find
Chaining commands with operators like &&, ;, and redirection to files
Watch out for
Common The Power OF The Command Line exam traps
- ▸Confusing ; with && — the semicolon runs the next command regardless, while && runs it only when the first succeeds.
- ▸Forgetting that grep '^d' matches lines starting with d, not directories specifically, so output depends on ls formatting.
- ▸Mixing up find's -mtime, -size, and redirection syntax, or writing the list to the screen instead of the target file.
Question index
All The Power OF The Command Line questions (59)
Click any question to see the full explanation, or start a practice session above.
A script named deploy.sh must run only when the preceding build command finishes without error. Which shell operator should you place between the two commands to achieve this?
Medium2Which TWO of the following commands can be used to view the contents of a file named 'data.txt'? (Choose two.)
Medium3You need to determine the absolute path of the `python3` executable that would run if you typed `python3` at the prompt. Which command displays this path?
Medium4A user wants to display the current working directory in the shell. Which command should they use?
Easy5You want to find lines in 'file.txt' that do NOT contain the word 'success'. Which command works?
Medium6What is the result of 'echo $USER'?
Medium7A developer is exploring a new project directory and wants to see the names of all files and directories, including those that start with a dot (hidden files). Which command should be used?
Easy8A user wants to redirect the standard error of a command to a file named errors.txt while still displaying standard output on the terminal. Which redirection is correct?
Medium9You need to display the contents of a file named 'config.txt' directly to your terminal screen. Which command should you use?
Easy10Which THREE of the following are valid ways to get help on a command?
Medium11Which TWO of the following regex patterns are valid for grep to match the beginning or end of a line?
Hard12Which THREE of the following tools can be used for text processing?
Easy13A colleague's shell script contains the line: find /var/log -name '*.log' -exec rm {} \; You need to explain what this line does before approving it. What is the effect of the -exec primary here?
Hard14Which command is used to display the current working directory in the terminal?
Easy15A user runs the command `grep '^root' /etc/passwd` and sees only the line starting with 'root'. They now want to find all lines that do NOT start with 'root'. Which command should they use?
Hard16Which TWO of the following commands can be used to redirect input from a file?
Hard17Which TWO of the following are commands to delete files or directories?
Easy18A user is at the shell prompt and wants to display the current working directory. Which command should be used?
Easy19While troubleshooting a service, a technician runs `ps aux` and sees a process in state `Z`. The process's parent is PID 1. Which statement best describes what the technician is observing?
Easy20Which symbol represents the current user's home directory in the shell?
Easy21You need to change the environment variable PATH to include the directory '/opt/bin'. Which command is standard?
Medium22You want to find all occurrences of the string 'ERROR' within the 'syslog' file. Which command is most appropriate?
Easy23A user wants to run a command that will continue running even after the terminal is closed. Which command should be used to achieve this?
Medium24A user wants to create a compressed archive of the directory /home/user/project, including all its subdirectories, and name the archive project.tar.gz. Which command should be used?
Hard25You are reviewing a shell script and need to identify commands that are handled internally by the shell rather than by launching a separate executable. Which two of the following are shell builtins? (Choose two.)
Medium26A system administrator needs to change the permissions of a script named backup.sh so that the owner can read, write, and execute it, while group members and others can only read and execute it. Which command accomplishes this?
Medium27Which THREE of the following are common shell built-in command types?
Medium28Which TWO of the following are valid commands for displaying file contents?
Easy29Which TWO of the following signals can be used to interact with processes?
Hard30Which THREE of the following are valid ways to run commands sequentially?
Hard31You need to find files modified within the last 7 days. Which find flag is correct?
Hard32A junior administrator runs `grep -r "timeout" /etc` inside a Bash login shell. The output scrolls past the terminal window, so the administrator wants to view the complete results one screen at a time while also being able to scroll back through the earlier lines. Which command should the administrator have used instead?
Hard33You want to execute two commands sequentially, but only if the first command succeeds. Which operator is used?
Hard34Which command removes a directory and all its contents recursively?
Easy35Which TWO of the following help manage compressed archive contents?
Hard36Which command-line shortcut allows you to autocomplete filenames and commands?
Easy37If you want to view a long text file page by page, which command is most suitable?
Medium38Which character is used to append output to an existing file without deleting its original content?
Easy39A teammate wants to search a large text file for lines containing the word 'error', ignoring case, and display the matching line numbers. Which command accomplishes this?
Medium40You need to set an environment variable named 'MYVAR' to 'hello' so that it is available to child processes. Which command is correct?
Medium41You wish to send the output of the 'ls -l' command directly into a file named 'dirlist.txt', overwriting any existing content. Which operator should you use?
Medium42Which command is used to display lines of a file that match a pattern, while ignoring case?
Easy43You need to create a compressed archive of the '/home/user/docs' directory named 'docs.tar.gz'. Which flag ensures gzip compression is applied?
Medium44A user wants to find all files under /home that are larger than 100 MB and were modified in the last 7 days. Which command accomplishes this?
Medium45What is the result of the command 'ls -la | grep "^d"'?
Medium46A user wants to find all files under /var/log that have been modified within the last 24 hours and are larger than 1 MB, then save the list to /tmp/recent_large.txt. Which command accomplishes this?
Medium47While troubleshooting a script, you run `grep -n 'error' /var/log/app.log` and see output lines prefixed with numbers. A colleague asks what those numbers represent. What do they indicate?
Medium48A user needs to find every regular file under /var/log whose name ends in `.log` and whose size is larger than 10 megabytes, then delete them. Which command accomplishes this safely?
Medium49A user wants to count the number of lines in a file named 'access.log'. Which command should be used?
Easy50A user runs `grep -E '^[A-Z][a-z]+ [0-9]{3}$' file.txt` and gets no output, even though file.txt contains lines like `Alpha 123` and `Beta 456`. What is the most likely explanation?
Hard51What does the command 'history' do?
Medium52How do you check the exit status of the last command executed?
Easy53A new administrator wants to see the manual page for the `cp` command to check its options. Which command should they run?
Easy54To sort the lines of a text file numerically instead of alphabetically, which flag do you use?
Medium55Which THREE of the following represent ways to manipulate command output in a pipe?
Medium56You want to replace every occurrence of 'old' with 'new' in the file 'data.txt' and view the result in the terminal. Which command achieves this?
Hard57A user wants to find all files in the /var/log directory that have been modified in the last 24 hours and display their names. Which command accomplishes this?
Medium58Which THREE of the following are environment variables commonly seen in a Linux shell?
Medium59You want to search for a file named 'notes.txt' starting from the root directory. Which command is most efficient?
HardOther domains
All 010-160 exam domains
Frequently asked questions
- What does the The Power OF The Command Line domain cover on the 010-160 exam?
- You must be able to build a working command line: pipe output through grep, use find with time and size filters, redirect results to a file, and choose && versus ; based on exit status. Getting the operator and redirection right is the single most important thing.
- How many questions are in this domain?
- This page lists all 59 The Power OF The Command Line questions in the 010-160 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
- What is the best way to practise this domain?
- Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
- Can I practise only The Power OF The Command Line questions?
- Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.