Google News
logo
Unix - Quiz(MCQ)

Unix : Unix is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.

Initially intended for use inside the Bell System, AT&T licensed Unix to outside parties in the late 1970s, leading to a variety of both academic and commercial Unix variants from vendors including University of California, Berkeley (BSD), Microsoft (Xenix), Sun Microsystems (SunOS/Solaris), HP/HPE (HP-UX), and IBM (AIX). In the early 1990s, AT&T sold its rights in Unix to Novell, which then sold the UNIX trademark to The Open Group, an industry consortium founded in 1996. The Open Group allows the use of the mark for certified operating systems that comply with the Single UNIX Specification (SUS).

A)
Unix is a text editor
B)
Unix is a software program
C)
Unix is an operating system
D)
Unix is a programming language

Correct Answer :   Unix is an operating system


Explanation : Unix is an operating system developed in the early 1970’s at Bell Labs by Dennis Ritchie, Ken Thompson, and others. It is a multiuser, multitasking and timesharing operating system. The power of Unix is derived from its commands and their multiple options.

A)
scripting, interpreter
B)
high level, low level
C)
interpreter, executing
D)
interactive, responsive

Correct Answer :   scripting, interpreter


Explanation : The UNIX shell is both an interpreter and scripting language. We can also say that shell can be interactive or non-interactive. When we log in to our system, interactive shell presents a prompt and wait for our requests while a non-interactive shell is managed by an interactive shell while executing a shell script.

A)
pat^
B)
^pat
C)
$pat
D)
pat$

Correct Answer :   ^pat

A)
chmod 777 emp*
B)
chmod 222 emp?
C)
chmod u+r ??? emp
D)
chmod u+x emp[1-3]

Correct Answer :   chmod u+x emp[1-3]

A)
cp chap* progs
B)
cp chap?? progs
C)
cp chap?? /progs/*
D)
cp chap[12] /progs/*.*

Correct Answer :   cp chap?? progs

A)
sh
B)
st
C)
sort
D)
sort -r

Correct Answer :   sort -r

A)
cat
B)
grep
C)
head
D)
more

Correct Answer :   head


Explanation : The head command displays the first few lines at the top of a file. It can be useful when you want a quick peek at a large file, as an alternative to opening the file.

A)
Profile
B)
Shadow
C)
Password
D)
All of the above

Correct Answer :   Password

A)
r
B)
R
C)
s
D)
S

Correct Answer :   R

A)
mv
B)
ren
C)
remove
D)
rename

Correct Answer :   mv

11 .
Which of the following commands is used to copy a file wb from the programs directory into a file called wbx in the misc directory?
A)
tar programs/wb misc/wbx
B)
copy programs/wb misc/wbx
C)
copy a:programs/wb b:misc/wbx
D)
cp programs/wb misc/wbx

Correct Answer :   cp programs/wb misc/wbx

A)
C
B)
C++
C)
Java
D)
Python

Correct Answer :   C


Explanation : UNIX was originally written in Assembly language but Dennis Ritchie and Ken Thompson wanted an operating system which could run on more than one type of hardware.

So in 1973, they rewrote the whole operating system in C language due to which one of the strongest features i.e. portability was added to the operating system.

A)
emacs
B)
vi
C)
ex
D)
ed

Correct Answer :   ed


Explanation : The first editor that was used in UNIX systems was ‘ed’. The main reason behind the replacement of ‘ed’ was that it can only edit files in the current directory and cannot execute shell commands.

A)
multiuser
B)
portability
C)
easy to use
D)
multitasking

Correct Answer :   easy to use


Explanation : UNIX is a multitasking operating system i.e. a user can run multiple tasks concurrently. Similarly, it is a multiuser system because it permits working with multiple users on a single operating system. But a major disadvantage of UNIX lies in the fact that the richness provided by its commands requires a special type of commitment to understand the subject. i.e. the user must be well aware of commands he is using and the functions performed by them.

A)
.exrc
B)
.profile
C)
.autoexec
D)
autoexec.bat

Correct Answer :   .profile

A)
Write permission for others
B)
Execute permission for the owner
C)
Read and write permission of groups
D)
All of the above

Correct Answer :   Write permission for others

A)
wc -c
B)
wc -l
C)
wc -r
D)
wc -w

Correct Answer :   wc -l

A)
cd
B)
cd/
C)
cd..
D)
cd HOME.

Correct Answer :   cd

A)
mv * /bin/*
B)
mv *.* /bin/
C)
mv * ../bin
D)
mv * ../bin *.*

Correct Answer :   mv * ../bin

A)
rd
B)
rdir
C)
dldir
D)
rmdir

Correct Answer :   rmdir

A)
s
B)
S
C)
r
D)
C

Correct Answer :   s

A)
cat
B)
cut
C)
grep
D)
paste

Correct Answer :   cut

A)
wc infile - newfile
B)
wc infile >newfile
C)
wc newfile
D)
wc infile | newfile

Correct Answer :   wc infile >newfile

A)
chmod go-x note
B)
chmod go+r note
C)
chmod go-r note
D)
chmod go+rw note

Correct Answer :   chmod go-r note

A)
ls *.*
B)
ls lst*
C)
ls *[lst]
D)
ls -l *.lst

Correct Answer :   ls -l *.lst

A)
-R
B)
-x
C)
-i
D)
-1

Correct Answer :   -R

A)
cd p
B)
cd p?
C)
cd p*
D)
cd [p]

Correct Answer :   cd p*

A)
chmod u+x letter
B)
chmod ugo+x letter
C)
chmod ugo+r letter
D)
chmod ugo+rw letter

Correct Answer :   chmod ugo+x letter

A)
UNIX was not written in ‘C’ language
B)
Linux is also known as a version of UNIX
C)
A user can run multiple programs at the same time; hence UNIX is called a multitasking environment
D)
Many people can use a UNIX based computer at the same time; hence UNIX is called as a multiuser system

Correct Answer :   UNIX was not written in ‘C’ language


Explanation : One of the most attractive features of UNIX is that it supports multi-user and multitasking environment which makes it so popular among its users. There are many UNIX variants available in the market. Solaris Unix, AIX, HP Unix, BSD are some of the examples. Linux is also a flavor of UNIX which is freely available. Unix was developed in 1969 by AT&T employees Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna at Bell Labs and was written in ‘C’.

A)
vi
B)
word
C)
notepad
D)
notepad++

Correct Answer :   vi


Explanation : It doesn’t matter what kind of work we are doing on a UNIX system, we always need an editor to edit some system files or ordinary files. For this purpose, vi editor is used in UNIX. Currently, vim (vi improved) is an improved version which is supported by LINUX systems.

A)
System Calls
B)
Kernel and Shell
C)
Commands and utilities
D)
Graphical user interface

Correct Answer :   Graphical user interface


Explanation : The kernel is the heart of the operating system while the shell is the utility which processes our requests. While system calls are a handful of functions which are used to interact with the kernel and make available the services provided by the operating system. A Graphical user interface (GUI) is available in UNIX, but the traditional UNIX interface is the command line only.

A)
Shell
B)
Vi editor
C)
Kernel
D)
Application program

Correct Answer :   Kernel


Explanation : The kernel is the core of the operating system. It is a collection of routines written in C which directly communicates with the hardware. User programs that need to interact with the hardware access the services of the kernel. There is only one kernel running on a system, unlike shells which can be multiple.

A)
man
B)
help
C)
search
D)
whatis

Correct Answer :   man


Explanation : UNIX provides us with a facility of man command, which is used for getting documentation of any command. For example, to seek help on wc command simply type man wc. This will simply display all the possible operations, options, description, synopsis of wc command. The POSIX specification requires only one available option with man command i.e. -k, which prints a one-line description of the command. whatis command is also available on many UNIX systems which also displays a one-line description of the command. man -f emulates the behavior of whatis command.

A)
cp
B)
cd
C)
rm
D)
pwd

Correct Answer :   cd


Explanation : cd (change directory) command is used for moving around the file system. cd command is usually invoked with a argument. After invocation, it changes the current directory to the directory specified as argument. Cp command is used for copying files while rm command is used for deleting files.

For example: our current directory is /bin/user06 and we want to change our directory to a directory named dir_one which is inside the user06 directory. To do so, type the following:

$ cd dir_one
$pwd
/bin/user06/dir_one​

A)
cat
B)
tee
C)
grep
D)
more

Correct Answer :   tee

A)
halt
B)
grep
C)
mesg
D)
sleep

Correct Answer :   mesg

A)
cp
B)
copy
C)
cp - p
D)
cpio

Correct Answer :   cpio

A)
mail
B)
write
C)
mesg
D)
calendar

Correct Answer :   calendar

A)
pg
B)
lp
C)
cat
D)
more

Correct Answer :   pg

A)
ls -F
B)
ls -l
C)
ls -x
D)
ls -l -d

Correct Answer :   ls -l -d

A)
.ch
B)
catch
C)
patch
D)
All of the above

Correct Answer :   All of the above

42 .
The Octal number to be given alogn with chmod command to make a file readable, writable and executable to the owner, readable and executable to group and others is:
A)
755
B)
744
C)
555
D)
000

Correct Answer :   755

A)
tty ^c
B)
stty intr \^c
C)
stty echoe
D)
stty echo \^a

Correct Answer :   stty intr \^c

A)
grep
B)
mail
C)
mesg
D)
write

Correct Answer :   grep

A)
liv
B)
ic
C)
nu
D)
nm

Correct Answer :   nu

A)
lp
B)
pg
C)
prn
D)
print

Correct Answer :   lp

A)
ai
B)
ts
C)
sm
D)
ic

Correct Answer :   ic

A)
ls -l
B)
ls -x
C)
ls -a
D)
ls -F

Correct Answer :   ls -a

A)
pwd
B)
cd
C)
dir
D)
HOME

Correct Answer :   pwd


Explanation : pwd command is used for checking our current directory. Current directory is the directory in which we are currently working. pwd displays the absolute pathname i.e. with respect to the root directory.

$ pwd
/home/user06/Abdullah​

A)
ps
B)
ls
C)
wc
D)
list

Correct Answer :   ls


Explanation : ls command is one of the most powerful commands used in UNIX system. It comes available with a bunch of options for listing files available in the directory. There are a number of options like -l, -a which are used for listing files in different manners according to user’s need.

$ ls
001.sh        
FILE2       
abc.txt
dir08​

A)
cp
B)
man
C)
reset
D)
passwd

Correct Answer :   passwd


Explanation : Since UNIX is a multiuser system, it requires a password from every user who wants to log in to the system to help ensure that all the data and files of the user are secure from hackers and errant users. A user can simply change his/her login password by using the passwd command. Simply type this command on the terminal and then enter the old password, which after successful verification would allow the user to input a new password for his login.

A)
cp
B)
rm
C)
cat
D)
mkdir

Correct Answer :   cat


Explanation : cat command is used to display the contents of a file. For displaying the contents, simply invoke the cat command with the filename (whose contents are to be displayed) as an argument. For example, if abd.txt file contains “HELLO WORLD” then,

$ cat abd.txt
HELLO WORLD​

A)
gzip
B)
cmp
C)
comm
D)
gunzip

Correct Answer :   gzip


Explanation : To conserve disk space we need to compress a file. gzip is a very popular program used with one or more filenames for compression.

$ gzip  file01.txt​

A)
lp
B)
pr
C)
head
D)
begin

Correct Answer :   head


Explanation : The head command is used for displaying the top of the file. As the name suggests, it displays the beginning of the file which is specified as an argument to the command. For example,

$ head emp.lst​

A)
$*
B)
$$
C)
$!
D)
$0

Correct Answer :   $$

57 .
Which option is used with cmp command to give a detailed list of the byte number and the differing bytes in octal for each character that differs in both the files?
A)
-b
B)
-d
C)
-r
D)
-l

Correct Answer :   -l

A)
[Control-c]
B)
[Control-d]
C)
[Control -P]
D)
[Control - u]

Correct Answer :   [Control - u]

A)
x
B)
X
C)
D
D)
dd

Correct Answer :   x

A)
|
B)
{
C)
}
D)
$

Correct Answer :   }

A)
cat emp[a-z]
B)
cat emp[x-z]
C)
cat emp[!0-9]
D)
more [emp][!0-9]

Correct Answer :   cat emp[!0-9]

A)
tr
B)
tee
C)
sort
D)
grep

Correct Answer :   tee


Explanation : The tee command reads standard input, then writes its content to standard output and simultaneously copies it into the specified file(s) or variables.

A)
rm
B)
mv
C)
del
D)
remove

Correct Answer :   rm

A)
:
B)
#
C)
$
D)
;

Correct Answer :   ;

66 .
Which of the following commands is used to absolutely assign all permissions to the owner, read and write permissions to the group and only executable permission to the others of the file note?
A)
chmod 761 note
B)
chmod 671 note
C)
chmod 167 note
D)
chmod 4=rwx, g=rw note

Correct Answer :   chmod 761 note

A)
chmod 333 note
B)
chmod 444 note
C)
chmod 666 note
D)
chmod 555 note

Correct Answer :   chmod 666 note

68 .
Which of the following commands is used to display the filenames in multiple columns with indication of directories and executable file?
A)
Ip
B)
ls -F -x
C)
ls -l
D)
ls ~ x

Correct Answer :   ls -F -x

A)
/
B)
?
C)
//
D)
??

Correct Answer :   /

A)
chmod g+x note
B)
chmod u+x note
C)
chmod u+w note
D)
chmod ugo+x note

Correct Answer :   chmod u+x note


Explanation : Users selection :

u - user: the owner of the file.
g - group: users who are members of the file's group.
o - others: users who are not the owner of the file or members of the group.
a - all: all three of the above, is the same as ugo.


Permissions :

r - read
w - write
x - execute

So, u+x => Execute (x) permission to Owner (u).

A)
–
B)
^
C)
%%
D)
+

Correct Answer :   +


Explanation : We can also address lines from the beginning instead of the end. The +count option allows us to do that, where count represents the line number from where the selection should begin. For example,

$ tail +11 emp.lst        // start printing from 11th line onwards​

A)
displaying diagnostic messages
B)
displaying errors
C)
displaying date and time
D)
displaying operating system details

Correct Answer :   displaying diagnostic messages


Explanation : echo command is generally used for displaying diagnostic messages on to the terminal or to issue prompt for reading the user input. All shells now have echo built in i.e. it is an internal command.

$ echo hello
hello​

A)
delete a given file
B)
change the directory
C)
list all the available files in the current directory
D)
cp is a command used for copying files and directories

Correct Answer :   cp is a command used for copying files and directories


Explanation : cp command is basically used for creating a copy of source file or a group of files. The syntax of the command requires at least two filenames to be specified. If both the files specified are ordinary files, the first file will be copied to the second file. The syntax of cp command is cp source_filename destination_filename. The contents of the source file will be copied to the destination file in the same directory.

$ cp  file_01  file_02               // copies file_01 to file_02​

A)
cp
B)
move
C)
mv
D)
rename

Correct Answer :   mv


Explanation : mv command is used for renaming files. This command does not create a copy of the file, it simply renames it. To rename file1 to file2 simply type,

$ mv  file1  file2​

A)
diff
B)
cmp
C)
comp
D)
comm

Correct Answer :   cmp


Explanation : cmp command is used for comparing two files byte by byte. It displays the first mismatch and its location on the terminal. It does not bother about subsequent mismatches but displays only the first mismatch. As soon as the first difference is found, the command terminates and outputs the line and byte in which there is a difference. For example,

$ cmp  file01  file02
file01  file02 differ: Byte 20, Line 2​

diff command is used for converting one file into another in order to make them identical and comm is used for displaying the common elements in both the files.

A)
wc
B)
diff
C)
man
D)
count

Correct Answer :   wc


Explanation : UNIX provides a universal word counting program that allows us to count the number of words, lines and characters in a file. It takes a filename as an argument as produces a 4 column output.

$ wc file01
3   9   45  file01​

Above output indicates that file01 contains 3 lines, 9 words and 45 characters.

A)
ch
B)
chgrp
C)
chown
D)
chmod

Correct Answer :   chmod


Explanation : The chmod (change mode) command is used to change the permissions of files. This command can only be run by the owner of the file or by the super user.

A)
chmod a-rw
B)
chmod go+r note
C)
chmod ugo=r note
D)
chmod u+r,g+r,o-x note

Correct Answer :   chmod ugo=r note

A)
A
B)
a
C)
I
D)
i

Correct Answer :   A

A)
executable permission only
B)
both read and write permissions
C)
write and executable permissions
D)
both read and executable permissions.

Correct Answer :   both read and write permissions

81 .
Which of the following commands is used to save the output of the who command in a file named user.lst, as well as display it?
A)
who > user.lst
B)
who < user.lste
C)
who >> user.lst
D)
who | tee user.lst

Correct Answer :   who | tee user.lst

A)
*
B)
?
C)
[ijk]
D)
[!ijk]

Correct Answer :   *

A)
erxc
B)
logic
C)
profile
D)
shell

Correct Answer :   shell

A)
cat
B)
wc
C)
grep
D)
touch

Correct Answer :   touch

A)
wc -r
B)
wc -w
C)
wc -c
D)
wc - 1

Correct Answer :   wc -c

A)
lp
B)
ls
C)
dir
D)
tar

Correct Answer :   ls

A)
od
B)
cd
C)
of
D)
oct

Correct Answer :   od

A)
ls | wc
B)
ls | ws -c
C)
ls | wc -w
D)
ls -l | wc -l

Correct Answer :   ls | wc -w

A)
cd
B)
cd ..
C)
cd/
D)
chdir

Correct Answer :   cd ..

90 .
Which command is used to delete all files in the current directory as well as all files and sub-directories in its subdirectories?
A)
rm *
B)
rm *.*
C)
rm all
D)
rm -r *

Correct Answer :   rm -r *

A)
cd
B)
cdir
C)
chdir
D)
changedir

Correct Answer :   cd

A)
.
B)
*
C)
$
D)
&

Correct Answer :   .


Explanation : To change permissions for hidden files, use the (.) symbol with chmod command.
 

$ chmod 755  .    // works on hidden files​

A)
:f
B)
:q
C)
:w
D)
‘:x’

Correct Answer :   ‘:x’


Explanation : ‘:x’ command saves our content and quits the editor simultaneously. This command is invoked in ex-mode.

A)
using ctrl-D
B)
using ctrl-Z
C)
using ‘:sh’ command and using ctrl-Z
D)
using ‘:sh’ command

Correct Answer :   using ‘:sh’ command and using ctrl-Z


Explanation : We can escape to the shell without quitting the editor using ‘:sh’ command or ctrl-Z. Sometimes it is necessary to return to shell prompt to execute a UNIX command or compile our program. For this purpose, we use these commands.

A)
chdir and chown
B)
mkdir and chdir
C)
mkdir and rmdir
D)
rmdir and chown

Correct Answer :   mkdir and chdir


Explanation : A non privileged user uses mkdir and rmdir calls for creating and removing directories respectively.

A)
rd
B)
rdir
C)
remove
D)
rmdir

Correct Answer :   rmdir

A)
pat$
B)
$pat
C)
pat^
D)
^pat

Correct Answer :   pat$

A)
/sales > empl.lst
B)
cut sales empl.lst
C)
grep sales empl.lst
D)
cat | /sales > empl.lst

Correct Answer :   grep sales empl.lst

A)
R
B)
j
C)
S
D)
rch

Correct Answer :   j

A)
/pat
B)
:pat
C)
?pat
D)
All of the above

Correct Answer :   /pat

A)
$*
B)
$#
C)
$0
D)
$!

Correct Answer :   $!

A)
-f
B)
-1
C)
-2
D)
-4

Correct Answer :   -f

A)
mail
B)
mesg
C)
wall
D)
write

Correct Answer :   wall

A)
*
B)
?
C)
[ijk]
D)
[!ijk]

Correct Answer :   ?

105 .
Which command is used to copy the three files wb, collect and mon into the misc directory, under the same, when you were currently in the programs directory?
A)
tar wb collect mon /misc
B)
cp wb collect mon ../misc
C)
copy wb collect mon /misc
D)
copy wb ../misc collect ../misc mon ../misc

Correct Answer :   cp wb collect mon ../misc

A)
/dev directory
B)
/tmp directory
C)
/unix directory
D)
/bin and /usr/bin directories

Correct Answer :   /bin and /usr/bin directories

107 .
Which of the following commands is used to remove files with confirmation prompt from the user file system which have neither been accessed nor modified i the last one year?
A)
find -mtime +365 | rm
B)
find -name - mtime + 365 / - ok rm
C)
grep (/usr/*) - mtime + 365 | -ok rm
D)
find /user/* \(-mtime + 365 - a - atime +365 \) - OK rm {} \;

Correct Answer :   find /user/* \(-mtime + 365 - a - atime +365 \) - OK rm {} \;

A)
du
B)
disk
C)
fdisk
D)
chkdsk

Correct Answer :   du

A)
st
B)
sh
C)
sort
D)
sort -r

Correct Answer :   sort

A)
/dev/tty
B)
/dev/null
C)
sample.txt
D)
/dev/null and /dev/tty

Correct Answer :   /dev/null and /dev/tty


Explanation : There are two special files named /dev/null and /dev/tty which is used in UNIX for special purposes. For example, if we want to check whether the program runs successfully without seeing its output on the screen or may not want to save output in a file either. For this purpose, a special file /dev/null is used. It accepts any stream without growing in size. The second file /dev/tty is the one used for indicating one’s terminal.

112 .
What is the output of the following Unix command?
$ wc  -c  *.c​
A)
erroneous
B)
undefined
C)
total size of .c files
D)
size of each .c file

Correct Answer :   total size of .c files


Explaination : We can make the command ignorant of its source using the pipeline. Above command is also an example of the same. It will simply display the total size of those files having a .c extension in the current directory.

A)
as an editor
B)
as a calculator
C)
for copying files
D)
as a process table viewer

Correct Answer :   as a calculator


Explanation : bc command is used for invoking calculator on UNIX system. It comes with a wide library for performing calculations. The power of this tool can be derived from the fact, that it can perform calculations up to and above 900 digits!

A)
shell
B)
bash
C)
parent
D)
System

Correct Answer :   shell


Explanation : As we log on to a UNIX system, a process is immediately set up by the kernel. This process represents a UNIX command which may sh (Bourne shell), ksh (Korn shell), csh (C shell) or bash (Bash). This process remains alive until we log out when it is killed by the kernel.

A)
ps
B)
$$
C)
pid
D)
HOME

Correct Answer :   ps


Explanation : ps command is used to show some attributes of a process. This command reads through the kernel’s data structures and process tables to fetch the characteristics of a process. By default, ps command displays the processes owned by the user running the command.

A)
read
B)
wait
C)
fork
D)
new

Correct Answer :   fork


Explanation : A process in UNIX is created using fork() system call. It creates an exact copy of the process that invokes it. Now there will be two processes, one parent process and one child process. The process which invokes the fork system call is called parent process and the new process created is called child process.

A)
< symbols
B)
> symbols
C)
<< symbols
D)
>> symbols

Correct Answer :   >> symbols

A)
to move cursor down by one line
B)
to move cursor left by one position
C)
to move cursor right by one position
D)
to move cursor to the beginning of the line specified by the number

Correct Answer :   to move cursor to the beginning of the line specified by the number

119 .
Which of the following commands is used to have a two-way communication with any person who is currently logged in?
A)
grep
B)
write
C)
mail
D)
mesg

Correct Answer :   write

A)
h
B)
i
C)
j
D)
k

Correct Answer :   h

A)
to process number of the current shell
B)
to list the positional parameters
C)
to name the command being executed
D)
to exit status of ast command executed.

Correct Answer :   to list the positional parameters

A)
print a file
B)
copy a file
C)
display a file
D)
capture a file

Correct Answer :   display a file

A)
256 bytes
B)
512 bytes
C)
1024 bytes
D)
2048 bytes

Correct Answer :   512 bytes

A)
kill 0
B)
kill 1
C)
cancel 1
D)
cancel all

Correct Answer :   kill 0

A)
-
B)
+
C)
%
D)
=

Correct Answer :   =

A)
!
B)
@
C)
$
D)
#

Correct Answer :   #

A)
-atime -365
B)
-mtime -365
C)
-atime +365
D)
-mtime + 365

Correct Answer :   -atime +365

A)
m user-list
B)
e user-list
C)
r user-list
D)
d user-list

Correct Answer :   m user-list

A)
/etc
B)
/usr
C)
/dev
D)
/tmp

Correct Answer :   /usr

A)
ls -1
B)
ls -t
C)
ls -i
D)
ls -R

Correct Answer :   ls -t

A)
to move the cursor backward to the beginning of a word
B)
to move the cursor to the upperleft corner of the screen
C)
to move the cursor to the first column in the current line
D)
to move the cursor to a matching delimiter, when a delimiters a parenthesis, a bracket, or a brace.

Correct Answer :   to move the cursor to a matching delimiter, when a delimiters a parenthesis, a bracket, or a brace.

A)
-a option
B)
-d option
C)
-r option
D)
-x option

Correct Answer :   -d option

A)
-c
B)
-d
C)
-s
D)
-i

Correct Answer :   -s

A)
chmod -R a+x progs
B)
chmod -1 a+x progs
C)
chmod -x a+x progs
D)
chmod -R 222 progs

Correct Answer :   chmod -R a+x progs

A)
tar programs/wb misc/wb
B)
copy programs/wb misc/wb
C)
cp programs/wb misc
D)
copy a:programs/wb b:misc/wb

Correct Answer :   cp programs/wb misc

A)
C shell
B)
Korn shell
C)
Smith shell
D)
Bourne shell

Correct Answer :   Bourne shell

A)
login
B)
shell
C)
home
D)
password

Correct Answer :   shell

A)
tail
B)
eof
C)
bof
D)
head - r

Correct Answer :   tail

A)
ls
B)
stty
C)
tty
D)
who

Correct Answer :   tty

A)
who the owner of the file is
B)
the name of the group owner of the file
C)
how large the file is and when the file was last modified.
D)
All of the above

Correct Answer :   All of the above

A)
chmod
B)
chgrp
C)
chusr
D)
chown

Correct Answer :   chmod

142 .
Which of the following commands can be used to get information about all users who are currently logged into the system?
A)
1 /u
B)
who
C)
which
D)
who am i

Correct Answer :   who

A)
ls profile
B)
l -u .profile
C)
cd /.profile
D)
find /-name profile -print

Correct Answer :   find /-name profile -print

A)
loc
B)
find
C)
type
D)
search

Correct Answer :   find


Explanation : find is one of the most powerful tools of the UNIX system. It recursively examines a directory tree to look for file matching based on some criteria and then takes some action on the selected files.

A)
pr
B)
cd
C)
cat
D)
print

Correct Answer :   pr


Explanation : The pr command is used for preparing a file by adding suitable headers, footers and formatted text. This command is used with a filename as an argument. For example,

$ pr  dept.lst
May  06  10:38  1998  dept.lst  Page 1
01:accounts:6213
02:admin:5423
03:marketing:6521
04:personnel:2365
 
.....blank lines.......​

A)
pr
B)
cut
C)
sort
D)
tail

Correct Answer :   sort


Explanation :  Sorting is the ordering of data in ascending or descending order. The sort command is used for ordering a file. Like cut command, sort also identifies fields and perform sorting on specified fields. To sort any file, just provide the name of the file as an argument with sort command.

$ sort emp.lst​

A)
cut
B)
sort
C)
uniq
D)
paste

Correct Answer :   uniq


Explanation : When we concatenate or merge files, we can encounter the problem of duplicate entries creeping in. UNIX offers a special command (uniq) which can be used to handle these duplicate entries. We can also use the sort -u command for doing the same piece of work.

A)
tr
B)
sort
C)
trans
D)
paste

Correct Answer :   tr


Explanation : The translate (tr) filter is used for manipulating individual characters in a line. Usually, tr command translates characters using one or two compact expressions. The syntax for using tr command is,

$ tr  options  expression1  expression2  standard input​

A)
grep “director”
B)
grep -director emp.lst
C)
grep -v “director” emp.lst
D)
grep “director” emp.lst

Correct Answer :   grep “director” emp.lst


Explanation : Because grep command is also a filter, it can search it’s standard input for the pattern. For example, the command grep “director” emp.lst will search the file emp.lst for the pattern “director” and will display the lines containing this pattern.

A)
td
B)
sed
C)
grep
D)
None of the above

Correct Answer :   sed


Explanation : sed is a multipurpose tool which performs the function of several filters together. This filter is derived from the ed (original UNIX editor). It performs non-interactive operations on a data stream. It uses instructions to act on a text for selecting lines, with an action to be taken.

A)
group of functions
B)
group of commands
C)
a file containing special symbols
D)
a file containing a series of commands

Correct Answer :   a file containing a series of commands


Explanation : When we have to execute a series of commands altogether, we store them in a file which is itself executed as a shell script. A shell script is basically a computer program designed to be run by the UNIX shell.

A)
other has read permission only
B)
owner has read permission only
C)
group has read permission only
D)
group has write permission only

Correct Answer :   group has read permission only

A)
first
B)
second
C)
third
D)
fourth

Correct Answer :   first


Explanation : root@server [~]# ls -l .... -rw------- 1 root root 37 Dec 31 2009 .my.cnf -rw------- 1 root root 737 Aug 18 21:20 .mysql_history -rw-r--r-- 1 root root 264 Aug 18 16:51 .pearrc ....

A)
dir
B)
pwd
C)
path
D)
prompt $p$g

Correct Answer :   pwd

A)
do
B)
ccp
C)
cmp
D)
comp

Correct Answer :   cmp

A)
tab
B)
space
C)
double tab
D)
underscore

Correct Answer :   tab


Explanation : To extract useful data from a file, we use the cut command to cut fields rather than columns. The cut command uses tab as the default delimiter to cut fields.

A)
creating files
B)
displaying files
C)
appending files
D)
deleting files

Correct Answer :   deleting files


Explanation : cat command cannot delete files. It can only be used for viewing file contents, creating a file or appending to an existing file.

A)
pr
B)
cut
C)
tail
D)
head

Correct Answer :   cut


Explanation : To extract specific columns from a file, we can use cut command followed by -c option and list of column numbers, delimited by a comma. For example,

$ cut  -c  6-22,24-32  emp.lst​

A)
split
B)
substr
C)
system
D)
length

Correct Answer :   system


Explanation : For running a UNIX command within awk, we’ve to use system function. For example,

BEGIN
{
      system(“date”)   // prints the system date ​

A)
+m.n
B)
-m.n
C)
+ n.m+1
D)
+(m+l).n

Correct Answer :   +m.n

A)
cancel
B)
kill
C)
haltsys
D)
shutdown

Correct Answer :   kill

A)
sed
B)
cut
C)
grep
D)
awk

Correct Answer :   awk


Explanation : The awk command made a later entry in the UNIX system. Like sed, it combines features of several filters. It is one of the most powerful filter after perl.

A)
chmod +r
B)
chmod +w
C)
chmod +x
D)
chmod +rwx

Correct Answer :   chmod +x


Explanation : Before we run the script, it is essential to make the script executable first. After that invoke the script name to run the script. For making the script executable, we have to use chmod +x script_name.

A)
df
B)
du
C)
dv
D)
mem

Correct Answer :   du


Explanation : Sometimes, we may need to find out the consumption of a specific directory rather than an entire file system. For this purpose, du command is used. This command reports usage by recursive examination of the directory structure.

A)
su
B)
pu
C)
super
D)
admn

Correct Answer :   su


Explanation : Any user can acquire the status of superuser by using the su command. The only condition that needs to be fulfilled here is, he/she must be aware of the root password. For example,

$ su
Password: *****        //root’s password
#pwd
/home/abd             //prompt changes ( super user mode)​