- Unix / Linux for Beginners
- Unix / Linux - Home
- Unix / Linux - What is Linux?
- Unix / Linux - Getting Started
- Unix / Linux - File Management
- Unix / Linux - Directories
- Unix / Linux - File Permission
- Unix / Linux - Environment
- Unix / Linux - Basic Utilities
- Unix / Linux - Pipes & Filters
- Unix / Linux - Processes
- Unix / Linux - Communication
- Unix / Linux - The vi Editor
- Unix / Linux Shell Programming
- Unix / Linux - Shell Scripting
- Unix / Linux - What is Shell?
- Unix / Linux - Using Variables
- Unix / Linux - Special Variables
- Unix / Linux - Using Arrays
- Unix / Linux - Basic Operators
- Unix / Linux - Decision Making
- Unix / Linux - Shell Loops
- Unix / Linux - Loop Control
- Unix / Linux - Shell Substitutions
- Unix / Linux - Quoting Mechanisms
- Unix / Linux - IO Redirections
- Unix / Linux - Shell Functions
- Unix / Linux - Manpage Help
- Advanced Unix / Linux
- Unix / Linux - Standard I/O Streams
- Unix / Linux - File Links
- Unix / Linux - Regular Expressions
- Unix / Linux - File System Basics
- Unix / Linux - User Administration
- Unix / Linux - System Performance
- Unix / Linux - System Logging
- Unix / Linux - Signals and Traps
Unix Mock Test
This section presents you various set of Mock Tests related to Unix Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Unix Mock Test I
Answer : D
Explanation
Kernel is the core part of the OS and is odd one the rest are popular shells.
Q 2 - What is the option to create symbolic link for a file?
Answer : A
Explanation
-s is the option to create a symbolic/soft link and applicable for only files.
Q 3 - What is the option to create hard link for a directory?
Answer : D
Explanation
It is error to create a hard link for a directory.
Q 4 - The following command can list out all the current active logins.
Answer : C
Explanation
who lists out all the current active logins with the associated terminal types, time and host machine name.
Answer : B
Explanation
pwd (present working directory).
Q 6 - What is the file descriptor number which represents the STDOUT?
Answer : B
Explanation
0-STDIN, 1-STDOUT & 2-STDERR
Q 7 - What does the following command would do
$ cp ../file.
A - Copies the file from current directory to parent directory
B - Copies the file from parent directory to its parent directory
C - Copies the file from parent directory to current directory
Answer : C
Explanation
Dot dot (..) represents parent directory and Dot (.) represents current working directory.
Q 8 - Identify the environment variable which designates secondary prompt.
Answer : D
Explanation
PS2 stands for primary string two.
Answer : D
Explanation
A program in the execution state is called as process.
Q 10 - What is PPID?
A - Previous process identification
B - Priority process identification
Answer : C
Explanation
The parent process id of a child process.
Answer : C
Explanation
Yanking is the process of holding a text in the buffer.
Answer : B
Explanation
It tell the system to use which shell for executing the script file.
Q 13 - How does a comment can begin in a shell script file.
Answer : A
Explanation
A comment line begin with # (pound symbol) and is ignored by the shell.
Q 14 - What does the following command will do?
$ chmod 888 file
A - It enables r,w,x premissions for all users
B - It disable r,w,x permissions for all users
Answer : D
Explanation
We can provide the permission values in octal number system and 888 is not a valid octal number.
Q 15 - Which shell variable holds the first command line argument for a shell script?
Answer : B
Explanation
$0 represent the shell script file name itself. Starting with $1, are actual command line arguments sent to the shell script.
Q 16 - Let a = 5, b = 6. Choose the proper command to perform multiplication?
Answer : B
Explanation
As * hold special meaning suppress it by escaping with \.
Q 17 - Which filter can be applied on lines of text for arranging in ascending or descending order?
Answer : A
Explanation
Sort command, a filter used to sort the text in Lexi logical or numerical order.
Q 18 - Which shell operator can be used to place a command to execute in background?
Answer : B
Explanation
Syntax is command &.
Answer : B
Explanation
False. We can kill only the processes for which we are owner.
Q 20 - Which of the following is correct to create an alias name for 'ls' as 'list'?
Answer : A
Explanation
Syntax is alias alias-name=”command”.
Q 21 - Choose the correct from below to search for lines beginning with the pattern using grep.
Answer : A
Explanation
The pattern can be enclosed in single quotes to suppress meaning of all the meta-characters special meanings.
Q 22 - Copy all the .doc extension files with file name having only 3 characters into the directory called “confi”, which is in parent directory.
Answer : A
Explanation
??? -> to match for any 3 characters. Dot dot (..) represents parent directory.
Answer : D
Explanation
rmdir can be used only if the directory is empty. We can remove the directory if non-empty using recursive option with ‘rm’, as a directory is even a file for UNIX/Linux.
Q 24 - Choose the option to remove write permission for group & others for a file “a.txt”.
A - Select disable write for group and others where file=”a.txt”
Answer : B
Explanation
Q 25 - Choose the command to list only the file “error.txt”
Answer : D
Explanation
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | A |
3 | D |
4 | C |
5 | B |
6 | B |
7 | C |
8 | D |
9 | D |
10 | C |
11 | C |
12 | B |
13 | A |
14 | D |
15 | B |
16 | B |
17 | A |
18 | B |
19 | B |
20 | A |
21 | A |
22 | A |
23 | D |
24 | B |
25 | D |
To Continue Learning Please Login
Login with Google