You are on page 1of 2

Modules

:
Date
:
Max.Marks :
Duration
:

Unix
20
mins.

I. Multiple Choice :
( 1 X 20 )
1. The correct unix command to display the contents of a file is
a)cat
b)more
c)less
d)all of the above

d none of the above


2. Write the command to display the current date in the form
dd/mm/yyyy.
a)date +%d/%m/%Y,
b) date +"%d/%m/%Y"
c) date +/%d/%m/20%y
d) date +"/%d/%m/20%y".
3. What command is used to copy files and directories?
a) copy
b) cp
c) rn
d) cpy
4. Which command is used to rename a file?
a) ren
b) rn
c) mv
d) mvdir
5. How do you show lines 5 to 10 of the file {\tt foo}?
a)tail +5 foo | head
b)tail +10 foo | head -5
c)head foo | tail +5
d)head -5 foo | tail +10
6. Which one is used to select only one copy of the repeated lines?
a)uniq -u
b)uniq -d
c) uniq -c
d) uniq I
7.The permission -rwxr--r-- represents in octal expression is (IV)
a)777
b)666
c)744
d)711
8 how do u search for blank lines
a) grep '^$' files
b) grep v \.$ files
c) grep -l 1,$ files
d) grep empty files
9.Indicate the right option to search for BOB, Bob, BOb or BoB ,
a) grep i Bob files
b) grep 'B[oO][bB]' files
c) grep '[BOB]' files
d) grep -v 'Bob files
10. Indicate the right option to search for anything not a letter or
number
a) grep '^[a-zA-Z0-9]
b) grep '[^a-zA-Z0-9]
c) grep '[a-zA-Z0-9]
d) None of the above
11 The command syntax to display the file 'sample.txt' one page at a
time is
a. man sample.txt>more

1 of 2

b.cat sample.txt<more
c.cat sample.txt|more
d None of the above
12. Which one shows the name of the operating system?
a. uname -n
b.uname -r
c.uname
d.uname m
13. How do you remove duplicate lines from the file foo using uniq?
A sort foo|uniq u
B sort -u foo|uniq -d
C sort foo| uniq c
D sort foo| uniq I
14 Which of these commands will set the permissions on file textfile
to read and write for the owner, read for the group, and nothing for
everyone else?
a. chmod 046 textfile
b. chmod 640 textfile
c. chmod 310 textfile
d. chmod rw r nil textfile

2 of 2

You might also like