Unix Questions

Practice Unix MCQs with answers and explanations. Page 2 of 7.

Category
Computer Science
Topic
Unix
Page
2 / 7
Mode
Practice

Questions

Open any question to view the answer and explanation.

On Unix/Linux, which command is commonly used both to display file contents and, via redirection, to create simple files?
Open
View answer
Which ls invocation shows the attributes of a directory entry itself (permissions, owner, size, timestamp) rather than listing its contents?
Open
View answer
In Unix/Linux file management, which command is used to remove (delete) a file from the filesystem?
Open
View answer
In the classic Unix 'mail' command interface, which single-letter command saves the current message into a separate file (mailbox or named file)?
Open
View answer
From a Unix/Linux perspective, does the cp (copy) command use standard input or standard output streams during normal file-to-file copying?
Open
View answer
Which of the following is not considered a user-to-user communication command in Unix/Linux environments?
Open
View answer
In Unix/Linux system administration, which command is used to display the characteristics and current status of running processes (for example, PID, TTY, time, and command)?
Open
View answer
In the vi editor on Unix/Linux, which command inserts text immediately to the left of the current cursor position (that is, before the cursor)?
Open
View answer
On Unix/Linux, which command makes all files and subdirectories within the directory named 'progs' executable by all users (recursively)?
Open
View answer
On a Unix-like terminal, if you want to use Control-C as the interrupt key instead of Delete, which stty command correctly sets the interrupt character?
Open
View answer
In the vi editor, which single-key motion command moves the cursor forward to the next paragraph boundary (that is, to the end of the current paragraph / start of the next)?
Open
View answer
In Unix/Linux process control, which command is commonly used to terminate a running process by sending a signal (for example, SIGTERM or SIGKILL)?
Open
View answer
In Unix/Linux filesystem management, which command removes a directory (typically only if it is empty)?
Open
View answer
Which Unix/Linux command sorts the lines of a file in reverse (descending) order directly from the command line?
Open
View answer
On a Unix/Linux shell, which single character is used to separate multiple commands on the same command line so they run sequentially?
Open
View answer
In Unix/Linux pipelines, which command reads from standard input, writes the same data to standard output, and simultaneously copies it into a file?
Open
View answer
In a POSIX shell, assume the current directory contains files named 'patch', 'catch', and '.ch' (a hidden file). Using the command cat ch (where globs that do not begin with a dot do not match hidden files), which filenames will be displayed?
Open
View answer
In the vi editor, which single-key command replaces exactly one character under the cursor with new text you type?
Open
View answer
On Unix/Linux systems, which command is used to display the top portion (beginning) of a file efficiently?
Open
View answer
Change file permissions for names starting with 'emp' and ending with 1, 2, or 3 so that the user (owner) gains execute permission: which chmod command is appropriate?
Open
View answer

Practice smarter

Solve a few questions daily and revisit weak topics regularly to improve accuracy.