Unix Questions

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

Category
Computer Science
Topic
Unix
Page
1 / 7
Mode
Practice

Questions

Open any question to view the answer and explanation.

In UNIX-style permissions, which chmod octal sets: owner = read/write/execute, group = read/execute, others = read/execute?
Open
View answer
In UNIX 'du' usage, which option displays the number of blocks used by a file (summarized usage)?
Open
View answer
On UNIX/Linux systems, which ps option shows a full-format listing, including the entire command line of each process?
Open
View answer
Which UNIX command is used to display a file's contents in octal (and other base) representations?
Open
View answer
In UNIX/Linux file permissions, what does the second permission triad (e.g., r--) indicate for the file's group?
Open
View answer
In POSIX shells, which special variable expands to the process ID (PID) of the most recently executed background job?
Open
View answer
In Unix/Linux command-line usage, which command is specifically used to identify the type of a file based on its content and metadata (rather than just the filename extension)?
Open
View answer
In the vi editor on Unix/Linux, which command syntax performs a forward search for the pattern ‘‘pat’’ from the current cursor position?
Open
View answer
On Unix/Linux, which command is used to create files and/or update only the access and modification timestamps without changing content?
Open
View answer
For the Unix/Linux touch command, which specific option targets changing only the access time (atime) of a file?
Open
View answer
On multi-user Unix/Linux systems, which command broadcasts a message to all users currently logged in (for example, for maintenance notices)?
Open
View answer
Which exact wc (word count) option counts only the number of bytes/characters in a file on Unix/Linux?
Open
View answer
On Unix/Linux, which command is designed to extract specific columns or fields from each line of a file or standard input?
Open
View answer
In the Unix/Linux cut command, which option is used to specify the field delimiter character for splitting input lines into fields?
Open
View answer
Which redirection pipeline sends the output of the wc command (run on infile) into a new file named newfile in Unix/Linux?
Open
View answer
In Unix/Linux, which rm option enables interactive mode so that the command prompts for confirmation before deleting each file?
Open
View answer
In Unix/Linux command-line usage, which command is used to list the contents of directories (i.e., show files and subdirectories)?
Open
View answer
In the Unix sort command (historical POSIX/legacy syntax), which position option begins sorting after the nth column of the (m+1)th field?
Open
View answer
Which shell glob correctly concatenates all files whose names start with 'emp' and are followed by a single non-numeric character?
Open
View answer
Which command copies all files whose names contain the string 'chap' followed by exactly two additional characters into the directory named 'progs'?
Open
View answer

Practice smarter

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