Unix Questions
Practice Unix MCQs with answers and explanations. Page 7 of 7.
Category
Computer Science
Topic
Unix
Page
7 / 7
Mode
Practice
Questions
Open any question to view the answer and explanation.
BSD mail (traditional mail user agent) — forward a message to another user list
In the classic BSD/Unix <code>mail</code> program's internal command set, which command forwards the current message to the specified user-list?
Open
View answer
Counting lines in a file on Unix/Linux
Which single command counts only the number of lines contained in a text file (no words or bytes)?
Open
View answer
Special shell parameters — process ID of the current shell
In POSIX/Bourne-compatible shells, which special parameter expands to the process number (PID) of the current shell instance?
Open
View answer
vi editor command-line corrections — back up over typing errors
When entering ex/vi commands (for example, after typing a colon), which historical erase character is commonly used to back up over a single typing error on terminals that do not support a true Backspace key?
Open
View answer
Moving files up one level — send everything to ../bin
Which command moves all non-hidden files from the current directory into the bin subdirectory of the parent directory?
Open
View answer
Unix paging utilities:
Which command displays a text file one screenful at a time with a default page length of 24 lines, allowing you to move forward through the file content?
Open
View answer
Shell redirection in Unix/Linux:
Which operator should you use to append the standard output to the end of an existing file instead of overwriting its current contents?
Open
View answer
UNIX filesystem fundamentals:
The traditional UNIX file system stores user data in physical disk blocks of which size (classic default on many systems)?
Open
View answer
User-to-user communication on multiuser Unix systems:
Which command enables an immediate two-way text conversation with another user who is currently logged in (real-time messaging to a terminal)?
Open
View answer
Bourne/Bash shell special parameters:
In POSIX shells, what does the special variable $* expand to during script execution?
Open
View answer
Finding stale files by access time:
With the Unix find command, which primary selects files that have not been accessed for more than 365 days?
Open
View answer
Controlling terminal messaging on Unix:
Which command can a user employ to allow or restrict incoming write/wall messages to their terminal session?
Open
View answer
Searching within files:
Which command displays every line containing the literal string 'sales' from the file named empl.lst?
Open
View answer
Capture and view output simultaneously:
Which command copies standard output to a file while also echoing it to the terminal at the same time?
Open
View answer
vi/Vim navigation shortcut:
In the vi editor, typing a line number followed by the uppercase letter G moves the cursor where?
Open
View answer
vi editor basics:
In the classic vi editor (or Vim in vi-compatibility mode), which command saves the current file to disk but keeps you in edit mode (does not quit)?
Open
View answer
Process control in UNIX:
Which command syntax sends a signal to all processes in your current process group (effectively terminating all your processes except the controlling login shell in many shells)?
Open
View answer
ls output formatting:
Which command lists filenames in multiple columns across the terminal (compact, side-by-side layout)?
Open
View answer
Practice smarter
Solve a few questions daily and revisit weak topics regularly to improve accuracy.