Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 24

1. Which symbol will be used with grep command to match the pattern pat at the beginning of a line?

A.
B.
C.
D.
E.

^pat
$pat
pat$
pat^
None of the above

Answer Option A
2.Which command is used to sort the lines of data in a file in reverse order
A.
B.
C.
D.
E.

sort
sh
st
sort -r
None of the above

Answer Option D
3.Which command is used to display the top of the file?
A.
B.
C.
D.
E.

cat
head
more
grep
None of the above

Answer Option B
4. Which command is used to copy all files having the string chap and any two characters after that to the progs
directory?
A.
B.
C.
D.
E.

cp chap?? progs
cp chap* progs
cp chap[12] /progs/*.*
cp chap?? /progs/*
None of the above

Answer Option A
5. Which command is used to change protection mode of files starting with the string emp and ending with 1,2,
or 3?
A.
B.
C.
D.
E.

chmod u+x emp[l-3]


chmod 777 emp*
chmod u+r ??? emp
chmod 222 emp?
None of the above

Answer Option A
6. Which command is used to remove a directory?
A.
B.
C.
D.
E.

rd
rmdir
dldir
rdir
None of the above

Answer Option B
7. Which of the following keys is used to replace a single character with new text?
A.
B.
C.
D.
E.

S
s
r
C
None of the above

Answer Option B
8. Which command is used to extract specific columns from the file?
A.
B.
C.
D.
E.

cat
cut
grep
paste
None of the above

Answer Option B
9. Which command sends the word count of the file infile to the newfile.
A.
B.
C.
D.
E.

wc infile >newfile
wc <infile >newfile
wc infile - newfile
wc infile | newfile
None of the above

Answer Option A
10. Which command is used to remove the read permission of the file 'note' from both the group and others?
A.
B.
C.
D.
E.

chmod go+r note


chmod go+rw note
chmod go-x note
chmod go-r note
None of the above

Answer Option D
11. Which of the following commands is used to display the directory attributes rather than its contents?
A.
B.
C.
D.
E.

ls -l -d
ls -l
ls -x
ls -F
None of the above

Answer Option A
12. Which of the following files will displayed by this command cat *ch*
A.
B.
C.
D.
E.

patch
catch
.ch
All of the above
None of the above

Answer Option D
13. 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.
B.
C.
D.
E.

000
755
744
555
None of the above

Answer Option B
14. If you are to use [Control-c] as the interrupt key instead of [Del], then you will have to use
A.
B.
C.
D.
E.

tty ^c
stty intr \^c
stty echoe
stty echo \^a
None of the above

Answer Option B
15. Which of the following is not a communication command.
A.
B.
C.
D.
E.

write
mesg
mail
grep
None of the above

Answer Option D
16. Which of the following keys is used to move the cursor to the end of the paragraph.
A.
B.
C.
D.
E.

}
{
|
$
None of the above

Answer Option A
17. Which command is used to concatenate all files beginning with the string 'emp' and followed by a nonnumeric characters?
A.
B.
C.
D.
E.

cat emp[!0-9]
more [emp][!0-9]
cat emp[x-z]
cat emp[a-z]
None of the above

Answer Option A
18. The command which transcribes the standard input to the standard output and also makes a copy of the same
in a file is
A.
B.

tee
tr

C.
D.
E.

sort
grep
None of the above

Answer Option A
19. Which command is used to remove a file?
A.
B.
C.
D.
E.

remove
rm
mv
del
None of the above

Answer Option B
20. Which symbol is used to separate more than one command in the same command line?
A.
B.
C.
D.
E.

$
#
;
None of the above

Answer Option D
21. The agency that sits between the user and the UNIX system is called the
A.
B.
C.
D.
E.

logic
profile
shell
erxc
None of the above

Answer Option C
22. Which of the following commands is used to update access and modification times of a file?
A.
B.
C.
D.
E.

grep
wc
touch
cat
None of the above

Answer Option C
23. Which command is used to count just the number of characters in a file?
A.
B.
C.
D.
E.

wc - 1
wc -c
wc -w
wc -r
None of the above

Answer Option B
24. Which of the following commands is used to list contents of directories?
A.

ls

B.
C.
D.
E.

lp
dir
tar
None of the above

Answer Option A
25. Which command is used to display a file contents in octal form?
A.
B.
C.
D.
E.

cd
od
of
oct
None of the above

Answer Option B
26. Which command will be used with vi editor to insert text to left of cursor?
A.
B.
C.
D.
E.

s
S
a
i
None of the above

Answer Option D
27.In vi editor, forward search is performed using the command.
A.
B.
C.
D.
E.

pat
?pat
/pat
All of the above
None of the above

Answer Option C
28. Which of the following special shell variables is used to process number of the last background job?
A.
B.
C.
D.
E.

$!
$#
$0
$*
None of the above

Answer Option A
29. Which option will be used with ps command to slow the entire command line of the process being run?
A.
B.
C.
D.
E.

-4
-f
-1
-2
None of the above

Answer Option B
30. Which of the following command addresses all users who are currently hooked on?

A.
B.
C.
D.
E.

write
mail
wall
mesg
None of the above

Answer Option C
31. Which option is used with rm command to make the command prompt the user with each filename and a ?,
before acting on it
A.
B.
C.
D.
E.

-r
-x
-i
-1
None of the above

Answer Option C
32. Which of the following directories contain all the Alias created by a user, including his login directory?
A.
B.
C.
D.
E.

/tmp
/etc
/usr
/dev
None of the above

Answer Option C
33. Which of the following commands is used to obtain a list of all files by modification time?
A.
B.
C.
D.
E.

ls -1
ls -t
ls -i
ls -R
None of the above

Answer Option B
34. The % key allows you
A.
B.
C.
D.
E.

to move the cursor to a matching delimiter, when a delimiters a parenthesis, a bracket, or a brace.
to move the cursor to the upperleft corner of the screen
to move the cursor backward to the beginning of a word
to move the cursor to the first column in the current line
None of the above

Answer Option A
35. Which command is used to display the characteristics of a process?
A.
B.
C.
D.
E.

pid
du
ps
au
None of the above

Answer Option C

36. Which of the following commands is used to identify the type of file by context?
A.
B.
C.
D.
E.

ls
cat
file
more
None of the above

Answer Option C
37. The field separator in cut command is specified with
A.
B.
C.
D.
E.

-a option
-d option
-r option
-x option
None of the above

Answer Option B
38. Which of the following options will be used to display number of blocks used by a file?
A.
B.
C.
D.
E.

-c
-i
-d
-s
None of the above

Answer Option D
39. Which option will be used with touch command to change the access time?
A.
B.
C.
D.
E.

-a
-b
-t
-h
None of the above

Answer Option A
40. Which command is used to make all files and sub-directories in the directory (progs) executable by all
users?
A.
B.
C.
D.
E.

chmod -R a+x progs


chmod -R 222 progs
chmod -1 a+x progs
chmod -x a+x progs
None of the above

Answer Option A
41.Which command is used to display and create files?
A.

cat

B.
C.
D.
E.

vi
ed
lyrix
None of the above

Answer Option A
42. The second set of the three permissions (r-) indicates that
A.
B.
C.
D.
E.

group has read permission only


other has read permission only
owner has read permission only
group has write permission only
None of the above

Answer Option A
43. Which column contains all details of the permissions of a file when you issue the ls -l command?
A.
B.
C.
D.
E.

second
fourth
third
first
None of the above

Answer Option D
44. Which of the following commands is used to display your working directory?
A.
B.
C.
D.
E.

dir
prompt $p$g
pwd
path
None of the above

Answer Option C
45. While working with mail command, which command is used to save mail in a separate file?
A.
B.
C.
D.
E.

s
r
w
d
None of the above

Answer Option A
46. The command used to compare the files is known as
A.
B.
C.
D.
E.

comp
cmp
do
ccp
None of the above

Answer Option B
47. Which command is used to terminate a process?

A.
B.
C.
D.
E.

shutdown
haltsys
cancel
kill
None of the above

Answer Option D
48. Which option will be used with sort command to start sorting ofter the nth column of the (m+l)th field?
A.
B.
C.
D.
E.

-m.n
+m.n
+ n.m+1
+(m+l).n
None of the above

Answer Option B
49. The cp command uses
A.
B.
C.
D.
E.

standard input file


standard output file
both input and output file
neither standard input nor standard output file
None of the above

Answer Option D
50. Which of the following files contains information related to password aging?
A.
B.
C.
D.
E.

Shadow
password
profile
All the three
None of the above

Answer Option B
51. Which command will be used with vi editor to replace text from cursor to right?
A.
B.
C.
D.
E.

r
R
s
S
None of the above

Answer Option B
52. Which of the following commands is used to rename a file?
A.
B.
C.
D.

rename
remove
mv
ren

E.

None of the above

Answer Option C
53. Which of the following is not a filter?
A.
B.
C.
D.
E.

cat
grep
wc
sort
None of the above

Answer Option E
54. 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.
B.
C.
D.
E.

copy programs/wb misc/wbx


cp programs/wb misc/wbx
tar programs/wb misc/wbx
copy a programs/wb b misc/wbx
None of the above

Answer Option B
55. Which command is used to list all the files with extension .lst?
A.
B.
C.
D.
E.

ls -l *.lst
ls lst*
ls *.*
ls *[lst]
None of the above

Answer Option A
56. Which option is used with the chmod command recursively to all files and sub-directories in a directory?
A.
B.
C.
D.
E.

-1
-i
-x
-R
None of the above

Answer Option D
57. Which command is used to change directory to the file beginning with a 'p'?
A.
B.
C.
D.
E.

cd p
cd p?
cd p*
cd [p]
None of the above

Answer Option C
58. Which of the following is invalid filename?

A.
B.
C.
D.
E.

shutry
TRY
trial
my .file
None of the above

Answer Option E
59. Which commands is used to assign executable permission to all of the files named "letter"?
A.
B.
C.
D.
E.

chmod ugo+r letter


chmod ugo+rw letter
chmod u+x letter
chmod ugo+x letter
None of the above

Answer Option D
60. Which set option is used with vi editor to display line numbers on screen?
A.
B.
C.
D.
E.

nm
nu
ic
li
None of the above

Answer Option B
12. Which command is used to print a file?
A.
B.
C.
D.
E.

print
prn
pg
lp
None of the above

Answer Option D
13. Which command will be used with vi editor to replace single character under cursor with any number of
characters?
A.
B.
C.
D.
E.

s
S
a
i
None of the above

Answer Option A
14. Which of the following set options is used with vi editor to ignore case while searching for patterns?
A.
B.
C.
D.
E.

ic
ai
sm
ts
None of the above

Answer Option A
15. Which command is used to list out all the hidden files along with the other files?
A.
B.
C.
D.
E.

ls -l
ls -x
ls -F
ls -a
None of the above

Answer Option D
16. 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.
B.
C.
D.
E.

chmod 761 note


chmod 671 note
chmod 167 note
chmod 4=rwx, g=rw note
None of the above

Answer Option A
17.The chmod ugo+rw note command can be represented in octal notation as
A.
B.
C.
D.
E.

chmod 555 note


chmod 666 note
chmod 444 note
chmod 333 note
None of the above

Answer Option B
18. Which of the following commands is used to display the filenames in multiple columns with indication of
directories and executable file?
A.
B.
C.
D.
E.

ls -F -x
ls -l
ls ~ x
Ip
None of the above

Answer Option A
19.Which command is used with vi editor to search a pattern in the forward direction?
A.
B.
C.
D.
E.

/
?
//
??
None of the above

Answer Option A
20. Which of the following commands is used to assign executable permission to the owner of the file named
"note"?

A.
B.
C.
D.
E.

chmod g+x note


chmod u+w note
chmod u+x note
chmod ugo+x note
None of the above

Answer Option C

21. The command to count the number of files in the current directory by using pipes, is
A.
B.
C.
D.
E.

ls | wc
ls -l | wc -l
ls | wc -w
ls | ws -c
None of the above

Answer Option C

22. Which of the following commands is used to get directory one level up?
A.
B.
C.
D.
E.

cd
cd ..
cd/
chdir
None of the above

Answer Option B

23. Which of the following commands is used to count the total number of lines, words, and characters
contained in a file.
A.
B.
C.
D.
E.

count p
wc
wcount
countw
None of the above

Answer Option B

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

rm *
rm -r *
rm all
rm *.*

E.

None of the above

Answer Option B

25. Which of the following commands is used to change the working directory?
A.
B.
C.
D.
E.

cd
changedir
chdir
cdir
None of the above

Answer Option A
26. Which of the following commands is used to view your file 24 lines at a time?
A.
B.
C.
D.
E.

pg
cat
lp
/p
None of the above

Answer Option A

27. Which shell's wild-cards is used to match a single character?


A.
B.
C.
D.
E.

*
?
[ijk]
[!ijk]
None of the above

Answer Option B

28. In Bourne shell, which file sets the Unix environment for the user when the logs into his HOME directory.
A.
B.
C.
D.
E.

.exrc
.profile
lastlogin
.mbox
None of the above

Answer Option B

29. 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.
B.
C.
D.
E.

copy wb ../misc collect ../misc mon ../misc


cp wb collect mon ../misc
copy wb collect mon /misc
tar wb collect mon /misc
None of the above

Answer Option B

30. The command chmod 761 note is equivalent to


A.
B.
C.
D.
E.

chmod 167 note


chmod u=rwx, g=rw, o=x note
chmo a =761 note
chmod 4=7, g=6,0 =1 note
None of the above

Answer Option B
31. The commonly used UNIX commands like date, ls, cat, etc. are stored in
A.
B.
C.
D.
E.

/dev directory
/bin and /usr/bin directories
/tmp directory
/unix directory
None of the above

Answer Option B

32. 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.
B.
C.
D.
E.

find -mtime +365 | rm


grep (/usr/*) - mtime + 365 | -ok rm
find -name - mtime + 365 / - ok rm
find /user/* \(-mtime + 365 - a - atime +365 \) - OK rm {} \;
None of the above

Answer Option D

33. Which of the following commands is used to summarize the disk usage?
A.
B.
C.
D.
E.

chkdsk
fdisk
du
disk
None of the above

Answer Option C

34. Which command is used to sort the lines of data in a file in alphabetical order?
A.
B.
C.
D.
E.

sort
sh
st
sort -r
None of the above

Answer Option A

35. If a file has read and write permissions for the owner, then the octal representation of the permissions will be
A.
B.
C.
D.
E.

1
6
5
3
None of the above

Answer Option B
36. Which command is used to copy a file wb with the same name from the programs directory to the misc
directory?
A.
B.
C.
D.
E.

copy programs/wb misc/wb


cp programs/wb misc
tar programs/wb misc/wb
copy a programs/wb b misc/wb
None of the above

Answer Option B

37. Which is the earliest and most widely used shell that came with the UNIX system?
A.
B.
C.
D.
E.

C shell
Korn shell
Bourne shell
Smith shell
None of the above

Answer Option C

38. The seventh field of /etc/password is


A.
B.
C.
D.
E.

password
login
shell
home
None of the above

Answer Option C

39. Which command is used to display the end of the file?


A.
B.
C.
D.
E.

head - r
tail
eof
bof
None of the above

Answer Option B

40. Which command is used to create a directory?


A.
B.
C.
D.
E.

crdir
md
mkdir
cr
None of the above

Answer Option C
41. Which command is used to display the device name of the terminal you are using?
A.
B.
C.
D.
E.

who
ls
tty
stty
None of the above

Answer Option C

42. The ls -l command tells


A.
B.

who the owner of the file is


the name of the group owner of the file

C.
D.
E.

how large the file is and when the file was last modified.
All of the above
None of the above

Answer Option D

43. Which option will be used with disk free command to include the total amount of disk space in the file
system?
A.
B.
C.
D.
E.

-t
-tt
-4
-i
None of the above

Answer Option A

44. Which command is used to set the three permissions for all the three categories of users of a file?
A.
B.
C.
D.
E.

chgrp
chown
chmod
chusr
None of the above

Answer Option C

45. Which of the following commands can be used to get information about yourself?
A.
B.
C.
D.
E.

who am i
i /4
pwd
which
None of the above

Answer Option A
46. Which of the following commands can be used to get information about all users who are currently logged
into the system?
A.
B.
C.
D.
E.

which
who
who am i
1 /u
None of the above

Answer Option B

47. Which of the following keys is used to overstrike a whole line?


A.
B.
C.
D.
E.

R
v
C
u
None of the above

Answer Option A

48. Which command is used to locate all the .profile files in the system?
A.
B.
C.
D.
E.

ls profile
find /-name profile -print
cd /.profile
l -u .profile
None of the above

Answer Option B
1. The File that contains a set of instructions which are performed when a user logs in, is
A.
B.
C.
D.
E.

.exrc
.profile
.autoexec
autoexec.bat
None of the above

Answer Option B

2. The octal representation 652 indicates


A.
B.
C.
D.
E.

Execute permission for the owner


Write permission for others
Read and write permission of groups
All of the above
None of the above

Answer Option B

3. Which of the following command is used to count just the number of lines contained in a file?
A.

wc -l

B.
C.
D.
E.

wc -c
wc -w
wc -r
None of the above

4. Which of the following command is used to go to home directory?


A.
B.
C.
D.
E.

cd..
cd/
cd
cd HOME.
None of the above

Answer Option C

5. Which command is used to move all files to the bin sub-directory of the parent directory?
A.
B.
C.
D.
E.

mv *.* /bin/
mv * /bin/*
mv * ../bin
mv * ../bin *.*
None of the above

Answer Option C
6. Which command is used to save the standard output in a file, as well as display it on the terminal?
A.
B.
C.
D.
E.

more
cat
grep
tee
None of the above

Answer Option D

7. The command that can be used to restrict incoming messages to a user is


A.
B.
C.
D.
E.

mesg
grep
halt
sleep
None of the above

Answer Option A

8. Which of the following commands is used to copy directory structures in and out
A.
B.
C.
D.
E.

cp
cpio
cp - p
copy
None of the above

Answer Option B

9. Which of following commands is used for an automatic reminder service?


A.
B.
C.
D.
E.

write
mesg
calendar
mail
None of the above

Answer Option C

10. Which command allows you to view your file 24 lines at a time?
A.
B.
C.
D.
E.

more
pg
cat
lp
None of the above

Answer Option B
11. Which of the following special shell variables is used to process number of the current shell?
A.
B.
C.
D.
E.

$!
$$
$0
$*
None of the above

Answer Option B

12. 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.

-l

B.
C.
D.
E.

-d
-r
-b
None of the above

Answer Option A

13. Which command is used with vi editor scroll half page backward?
A.
B.
C.
D.
E.

[Control-d]
[Control - u]
[Control-c]
[Control -P]
None of the above

Answer Option B

14. Which command is used with vi editor to move cursor forward to first occurrence of character 'ch' in the
current line?
A.
B.
C.
D.
E.

tch
fch
rch
ech
None of the above

Answer Option B

15. Which of the following keys is used to delete the character beneath the cursor?
A.
B.
C.
D.
E.

x
X
dd
D
None of the above

Answer Option A
16. Which command is used to assign only read permission to all three categories of the file 'note'?
A.
B.
C.
D.

chmod go+r note


chmod a-rw
chmod ugo=r note
chmod u+r,g+r,o-x note

E.

None of the above

Answer Option C

17.Which command will be used with vi editor to append text at end of line?
A.
B.
C.
D.
E.

A
a
i
I
None of the above

Answer Option A

18. The first set of the three permissions (rw) pertains to the owner of the file, indicating that the owner has
A.
B.
C.
D.
E.

executable permission only


write and executable permissions
both read and executable permissions.
both read and write permissions
None of the above

Answer Option D

19. 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.
B.
C.
D.
E.

who | tee user.lst


who > user.lst
who >> user.lst
who < user.lste
None of the above

Answer Option A

20. Which of the following shell's wildcards are used to match any number of characters including none?
A.

[ijk]

B.
C.
D.
E.

[!ijk]
?
*
None of the above

Answer Option D

You might also like