Unix Mock Test 2

24 Questions | Total Attempts: 8482

SettingsSettingsSettings
Please wait...
Unix Quizzes & Trivia

Unix Mock Test 2 Instructions: Please do not copy Please do not use Internet or Putty This is just a simple test to make know how much you understood the subject GOD BLESS YOU! ALL THE BEST! ---- Trainer: ManojKumar. A


Questions and Answers
  • 1. 
    Who helped Ken Thompson to recreate the Unix kernel in C language?
    • A. 

      Dennis Ritchie

    • B. 

      Dennis Machi

    • C. 

      Mark Shuttleworth

  • 2. 
    What are the types of devices in Unix?
    • A. 

      Block Oriented, Disk Oriented

    • B. 

      Character Oriented, Page Oriented

    • C. 

      Block Oriented, Character Oriented

  • 3. 
    Which among the following information is NOT stored in an iNode to a file?
    • A. 

      File Modification Time

    • B. 

      File Creation Time

    • C. 

      File Changed Time

  • 4. 
    Which among the following commands could not be used to see the inode number of a file?
    • A. 

      Ls -il

    • B. 

      File

    • C. 

      Stat

  • 5. 
    Which among these is a pesudo file system?
    • A. 

      Proc

    • B. 

      Dev

    • C. 

      Boot

  • 6. 
    To find out how long your system has been running?
    • A. 

      Time

    • B. 

      Time|cut -c2-4

    • C. 

      Uptime

  • 7. 
    In the output of $ ls -al which column shows the file size in bytes?
    • A. 

      5th column

    • B. 

      4th column

    • C. 

      2nd column

  • 8. 
    • A. 

      Provides all permission to user, read to group , read write to others

    • B. 

      Provides all permission to user, read write to group , read write to others

    • C. 

      Provides all permission to user, read write to group , read to others

  • 9. 
    How to add the following info in PATH? /home/dw023/software
    • A. 

      PATH=$PATH://home/dw023/software

    • B. 

      PATH=$PATH:/home/dw023/software

    • C. 

      PATH:=$PATH:/home/dw023/software

  • 10. 
    How to get to know the process status?
    • A. 

      Df

    • B. 

      Du

    • C. 

      Top

  • 11. 
    To display the first 24 lines in a file?
    • A. 

      Head 24 file

    • B. 

      Head -24 file

    • C. 

      Head +24 file

  • 12. 
    Echo "this is dw023."|wc contains which of the following values?
    • A. 

      14

    • B. 

      15

    • C. 

      13

  • 13. 
    Choose the odd one out
    • A. 

      Find

    • B. 

      Find .

    • C. 

      Find /

  • 14. 
    Echo "hi**this**is**cts"|cut -d "**" -f3
    • A. 

      Is

    • B. 

      Cts

    • C. 

      Error

  • 15. 
    For(( i=0;i<5;i++)) do  echo ___________________ done In the above code in the red lined place, how to access the array contents?
    • A. 

      ${arr[${i}]}

    • B. 

      ${arr${[i]}}

    • C. 

      ${arr[i]}

  • 16. 
    How do i find out an array size?
    • A. 

      ${arr[@]}

    • B. 

      ${#arr[@]}

    • C. 

      ${#arr[0]}

    • D. 

      @arr

  • 17. 
    How do i replace sherwin with sherlyn in my array?
    • A. 

      ${arr[@]/sherlyn/sherwin}

    • B. 

      ${#arr[@]/sherlyn/sherwin}

    • C. 

      ${arr[@]/sherwin/sherlyn}

    • D. 

      ${#arr[@]/sherwin/sherlyn}

  • 18. 
    How to delete an entire array?
    • A. 

      Unset #arr[@]

    • B. 

      Unset arr

    • C. 

      Unset @arr

    • D. 

      Unset ${arr[@]}

  • 19. 
    How to copy the contents of file into array?
    • A. 

      @arr = (cat "file.txt")

    • B. 

      Cat "file.txt"|@arr

    • C. 

      Arr = ( ` cat "file.txt" `)

  • 20. 
    If func1 is a shell subroutine.. and  i have a function call like this: func1 hi i am coder and inside func1, what would $2 print?
    • A. 

      I

    • B. 

      Hi

    • C. 

      Am

    • D. 

      Filename

  • 21. 
    Which among these is not a shell?
    • A. 

      T shell

    • B. 

      C shell

    • C. 

      K shell

  • 22. 
    How do you copy file from one host to other securely?
    • A. 

      Cp

    • B. 

      Scp

    • C. 

      Ssh

  • 23. 
    How do you rename file "new" in file "old"?
    • A. 

      Rn new old

    • B. 

      Cp new old

    • C. 

      Mv new old

  • 24. 
    What do you use to forward errors to a null?
    • A. 

      2> /dev/null

    • B. 

      1> /dev/null

    • C. 

      Echo error > /dev/null