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.
Q 1 - Choose the odd one out.
A - csh
B - bsh
C - ksh
D - Kernel
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?
A - –s
B - –l
C - –f
D - None of the above.
-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?
A - –s
B - –l
C - –f
D - None of the above.
It is error to create a hard link for a directory.
Q 4 - The following command can list out all the current active logins.
A - whoami
B - who am i
C - who
D - None of the above.
who lists out all the current active logins with the associated terminal types, time and host machine name.
Q 5 - Choose the command to print the current working directory
A - cwd
B - pwd
C - wd
D - nwd
pwd (present working directory).
Q 6 - What is the file descriptor number which represents the STDOUT?
A - 0
B - 1
C - 2
D - None of the above.
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
D - Error in the command
Dot dot (..) represents parent directory and Dot (.) represents current working directory.
Q 8 - Identify the environment variable which designates secondary prompt.
A - PP1
B - SP2
C - PS1
D - PS2
PS2 stands for primary string two.
Q 9 - A process is ___
A - Collection of threads
B - A thread
C - Software
D - A running program
A program in the execution state is called as process.
Q 10 - What is PPID?
A - Previous process identification
B - Priority process identification
C - Parent process identification
D - Pre Parent identification
The parent process id of a child process.
Q 11 - Which key combination can yank a line in vi?
A - yw
B - yc
C - yy
D - yl
Yanking is the process of holding a text in the buffer.
Q 12 - She-bang line in a shell script begins with__
A - #
B - #!
C - !#
D - None of the above.
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.
A - Beginning with #
B - Beginning with $
C - Beginning with !
D - None of the above.
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
C - It enables r,w,x permissions only for owner of the file
D - None of the above.
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?
A - $0
B - $1
C - #0
D - None of the above
$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?
A - expr $a * $b
B - expr $a \* $b
C - $(a*b)
D - None of the above.
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?
A - sort
B - arrange
C - collate
D - None of the above.
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?
A - |
B - &
C - &&
D - >
Syntax is command &.
Q 19 - We can kill any background executing process.
A - True
B - False
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'?
A - alias list=”ls”
B - alias list “ls”
C - alias “list” as “ls”
D - alias “ls” as “list”
Syntax is alias alias-name=”command”.
Q 21 - Choose the correct from below to search for lines beginning with the pattern using grep.
A - ^pattern
B - pattern^
C - $pattern
D - pattern$
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.
A - cp ???.doc ../confi
B - cp [1-3].doc ../confi
C - cp ???.doc /confi
D - None of the above.
??? -> to match for any 3 characters. Dot dot (..) represents parent directory.
Q 23 - Which command can be used to remove a non-empty directory?
A - rmdir
B - rd
C - ddir
D - rm
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”
B - chmod go-w a.txt
C - chmod w-go a.txt
D - chmod go=”r-x” a.txt
 
Q 25 - Choose the command to list only the file “error.txt”
A - ls *err*.txt
B - ls e*.txt
C - ls error.???
D - ls error.txt
 

    129 Lectures 
     23 hours 

 Eduonix Learning Solutions

    5 Lectures 
     4.5 hours 

 Frahaan Hussain

    35 Lectures 
     2 hours 

 Pradeep D

    41 Lectures 
     2.5 hours 

 Musab Zayadneh

    46 Lectures 
     4 hours 

 GUHARAJANM

    6 Lectures 
     4 hours 

 Uplatz
 Print
 Add Notes
 Bookmark this page