Mega Sasta


Course=os      Subject=shell

Question no-1
What will be the output of echo $SHELL?


Optional Answers

(a)                  /bin/bash

(b)                  #!/bin/bash

(c)                  SHELL

(d)                  none of the above

Sollution

(a)                  /bin/bash

Question no-2
Which command displays content of a file in reverse order?


Optional Answers

(a)                  tac filename

(b)                  cat filename

(c)                  tail filename

(d)                  head filename

Sollution

(a)                  tac filename

Question no-3
Which command can be used to make a file write only?


Optional Answers

(a)                  chmod +w filename

(b)                  chmod 222 filename

(c)                  both a and b

(d)                  none of the above

Sollution

(b)                  chmod 222 filename

Question no-4
What will be the output of following command? mv filename location


Optional Answers

(a)                  copies file to new location

(b)                  copies file to new location and deletes file at original location

(c)                  copies file at location to home directory

(d)                  none of the above

Sollution

(b)                  copies file to new location and deletes file at original location

Question no-5
Which command displays 5th line of a file?


Optional Answers

(a)                  cat file / head -n 5 / tail -n 1

(b)                  cat file / head -l 5 / tail -l 1

(c)                  cat file / tail -n 6 / head -n 1

(d)                  none of the above

Sollution

(d)                  none of the above

Question no-6
Which command displays time?


Optional Answers

(a)                  which

(b)                  time

(c)                  cal

(d)                  date

Sollution

(d)                  date

Question no-7
Which command is used to search lines of a file having a given string?


Optional Answers

(a)                  grep

(b)                  pattern

(c)                  find

(d)                  which

Sollution

(a)                  grep

Question no-8
What will be the output of:
name=varun
echo "my name is $varun"


Optional Answers

(a)                  my name is varun

(b)                  my name is name

(c)                  my varun is varun

(d)                  none of these

Sollution

Question no-9
Which id these expressions is correct?


Optional Answers

(a)                  if ( $a -gt 1 ); then fi

(b)                  if ( $a -gt 1 ) then fi

(c)                  if ( $a -gt 1 ) endif

(d)                  none of the above

Sollution

(d)                  none of the above

paper of os shell muj1

Paper of shell in os


     Roll no=     Name=
                                                                         BACK