Unix Questions
Practice Unix MCQs with answers and explanations. Page 3 of 7.
Category
Computer Science
Topic
Unix
Page
3 / 7
Mode
Practice
Questions
Open any question to view the answer and explanation.
On Unix/Linux systems, which command prints the absolute path of your current working directory in the shell?
Open
View answer
Which ls option lists files ordered by modification time (most recent first) in the current directory?
Open
View answer
With grep, which anchor matches the literal pattern 'pat' only at the beginning of a line in a text file?
Open
View answer
In Unix/Linux, what is the name of the interface that sits between the user and the operating system kernel, interpreting commands and launching programs?
Open
View answer
Which chmod command removes read permission on the file 'note' for both the group and others, without changing any other bits?
Open
View answer
In Unix/Linux, when using the long listing format (ls -l), which column shows the complete file permission string and file type indicator?
Open
View answer
On Unix/Linux, which command compares two files byte by byte to report the first difference or confirm they are identical?
Open
View answer
In the vi editor, what does pressing the % key do during text navigation and code editing?
Open
View answer
UNIX Text Sorting Basics
Which command sorts the lines of a text file into ascending (alphabetical) order by default?
Open
View answer
vi Editor: Replace Text from the Cursor Forward
In the standard vi editor, which command puts you into overwrite (replace) mode so that typing replaces existing text from the cursor to the right?
Open
View answer
UNIX Filters: Identifying Stream-Processing Commands
Which of the following is not a filter (i.e., a command commonly used in pipelines to read from standard input and write to standard output)?
Open
View answer
UNIX Copying Multiple Files to a Sibling Directory
From inside the programs directory, which command copies the three files wb, collect, and mon into the sibling directory ../misc while keeping their names?
Open
View answer
Where Core UNIX User Commands Reside
In a typical UNIX filesystem layout, where are common commands such as date, ls, and cat stored?
Open
View answer
Listing Files: Indicators and Multi-Column Output
Which ls invocation displays file names in multiple columns and appends indicators to classify entries (e.g., / for directories, * for executables)?
Open
View answer
Navigating Up One Directory Level in UNIX Shells
Which command changes the current working directory to its parent (one level up)?
Open
View answer
UNIX vi editor: Which :set option enables on-screen line numbers for every line while editing (for example, to assist with navigation and referencing specific lines)?
Open
View answer
Linux/UNIX file listing: Which command lists all files whose names end with the extension “.lst”, showing a detailed long listing for each match?
Open
View answer
UNIX shells history: Which shell was the earliest and became the most widely used default shell on classic UNIX systems?
Open
View answer
vi/vim search navigation: In the vi editor, which single-character command initiates a forward search for a text pattern from the current cursor position?
Open
View answer
Multi-user UNIX: Which command displays information about all users who are currently logged in to the system (terminals or sessions)?
Open
View answer
Practice smarter
Solve a few questions daily and revisit weak topics regularly to improve accuracy.