Follow Us On
follow us
paper of os shell muj

Exam section of megasasta.com

Paper of shell in os

Course=os
Subject=shell

Question no-1
Which instruction can be used to find path of current directory


Optional Answers

(a)                  pwd

(b)                  path

(c)                  who

(d)                  none of these

Sollution

(a)                  pwd

Question no-2
Which command prints the content of a file in reverse order? Assume file has 100 lines in all.


Optional Answers

(a)                  cat filename

(b)                  tac file name

(c)                  tail -n 100 filename

(d)                  head -n 100 filename

Sollution

(b)                  tac file name

Question no-3
Which command can be used to display current date and time?


Optional Answers

(a)                  date

(b)                  date | time

(c)                  echo "$date $time"

(d)                  none of these

Sollution

(a)                  date

Question no-4
What will be the output of following command?
echo $SHELL


Optional Answers

(a)                  /bin/bash

(b)                  #!/bin/bash

(c)                  SHELL

(d)                  1

Sollution

(a)                  /bin/bash

Question no-5
What will be the output of following commands?
#!/bin/bash
name=rohan
age=20
echo "$name is age years old"


Optional Answers

(a)                  rohan is age years old

(b)                  name is 20 years old

(c)                  rohan is 20 years old

(d)                  syntax error

Sollution

(a)                  rohan is age years old

Question no-6
Which command can be used to display 9th line of a file?


Optional Answers

(a)                  cat filename head -n 9 tail -n 1

(b)                  cat filename tail -n 9 head -n 1

(c)                  cat filename | head -n 99 | tail -n 90

(d)                  none of these

Sollution

(d)                  none of these

Question no-7
Which of the following has correct syntax?


Optional Answers

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

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

(c)                   if [ $a -gt 1 ]; do done

(d)                   none of these

Sollution

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

Question no-8
Which of the following code can be used to create 3 directories?


Optional Answers

(a)                  mkdir d1 d2 d3

(b)                  mkdir d1 mkdir d2 mkdir d3

(c)                  both a and b

(d)                  none of these

Sollution

(c)                  both a and b

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


Optional Answers

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

(b)                   copies file to new location

(c)                  copies file at location to home directory

(d)                  none of these

Sollution

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

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


Optional Answers

(a)                  chmod 222 filename

(b)                  chmod +x filename

(c)                  both a and b

(d)                  none of these

Sollution

(a)                  chmod 222 filename

Jai guru dev

We are giving free online platform/site so that indian people can give free advertisement to interchange their day to day goods online and product by post free advertisement or classified on mega sasta site by selling indian sasta saman online by this site. so that a wastage stuff of one indian person can be used by another indian person and both person can enjoy online or offline transaction free of cost by this site. buyer and seller both will be satisfy. Its a mega free advertisement online exchange for your day to day stuf without any mediator. You can give mega advertisement for indian car, bike, find coaching, furniture, buy sell books, table, mobile, plots, cloths, tv, laptops, vihicle, cell, phones, jeans, shirts, shoes, find jobs or antique. You can give free mega advertisement for anything on this site.

Creative Commons License
mega sasta by shubhali is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
Permissions beyond the scope of this license may be available at http://megasasta.com/contactus.php.