How Much Do You Know About Linux? Trivia Quiz

85 Questions | Total Attempts: 50

SettingsSettingsSettings
Please wait...
Linux Quizzes & Trivia

Questions and Answers
  • 1. 
    Identify all paths that represent absolute paths in Linux (SELECT ALL THAT APPLY)
    • A. 

      /

    • B. 

      /home/user/test1

    • C. 

      ./user/test1

    • D. 

      ../user/fstab

  • 2. 
    Select all the ways you can cd into test1 , a sub-directory of user1's home directory, /home/user1, given the command promt listed below (SELECT ALL THAT APPLY) [email protected]: /bin$
    • A. 

      Cd ./test1

    • B. 

      Cd ../test1

    • C. 

      Cd ../../test1

    • D. 

      Cd ~/test1

    • E. 

      Cd /home/user1/test1

  • 3. 
    Which linux command line copies directories dir1, dir2,  to dir3 (dir1,dir2 and dir3 are all located in the current working directory)?
    • A. 

      Cp dir1 dir2 dir3

    • B. 

      Cp -r dir1 dir2 dir3

    • C. 

      Cp --parent dir1 dir2 dir3

    • D. 

      Cp -p dir1 dir2 dir3

    • E. 

      None of the above

  • 4. 
    Identify the root user accounts home directory in Linux
    • A. 

      /

    • B. 

      /root/home

    • C. 

      /home/root

    • D. 

      /root

    • E. 

      None of the above

  • 5. 
    Identify the Linux command that renames a file named oldfile  to  newfile  in current working directory.
    • A. 

      Cp oldfile newfile

    • B. 

      Ren oldfile newfile

    • C. 

      Mv oldfile newfile

    • D. 

      Touch oldfile newfile

    • E. 

      None of the above

  • 6. 
    Which of the following Linux commands  prevents you from accidentally overwriting a file when you redirect output to a file?
    • A. 

      Echo $PATH

    • B. 

      Set +C

    • C. 

      Umask

    • D. 

      Set -noclobber

    • E. 

      None of the above

  • 7. 
    The Linux command that allows for deleting a directory, but only if it is empty_____________.
    • A. 

      Mv

    • B. 

      Del

    • C. 

      Rm

    • D. 

      Rmdir

    • E. 

      None of the above

  • 8. 
    What command can you use to remove a directory with files in it in Linux.
    • A. 

      Rm

    • B. 

      Rm -r

    • C. 

      Rmdir

    • D. 

      Rmdir -p

    • E. 

      None of the above

  • 9. 
    To immediately shutdown and halt a Linux machien from command line, you should:
    • A. 

      Log in as root and type: shutdown -h now

    • B. 

      Log in as root and type: shutdown -r now

    • C. 

      Log in as root and type: stop linux -1

    • D. 

      Turn power off and walk away

    • E. 

      None of the above

  • 10. 
    Identify the environment variable that defines primary prompt.
    • A. 

      PS1

    • B. 

      PS2

    • C. 

      SHELL

    • D. 

      HOME

    • E. 

      None of the above

  • 11. 
    The command that displays the name of current shell is ____________________.
    • A. 

      Echo $SHELL

    • B. 

      Cat /etc/shells

    • C. 

      Uname -r

    • D. 

      Cat /etc/fstab

    • E. 

      None of the above

  • 12. 
    Which of the following would not place you in your home directory?
    • A. 

      Cd

    • B. 

      Cd ~

    • C. 

      Cd ~/username

    • D. 

      Cd /home/username

    • E. 

      None of the above

  • 13. 
    Identify the linux command used to display the inode number of /etc/fstab
    • A. 

      Ls /etc/stab

    • B. 

      Ls -l /etc/fstab

    • C. 

      Ls -a /etc/fstab

    • D. 

      Ls -i /etc/fstab

    • E. 

      None of the above

  • 14. 
    What happens when you type the following command line at the given command prompt: [email protected] : ~$ cd .
    • A. 

      You remain in current directory

    • B. 

      You change into the parent directory

    • C. 

      You will get the error message "bash:...:unknown symbol"

    • D. 

      You will create a directory name ".."

    • E. 

      None of the above

  • 15. 
    The Linux command that prints the current working directory in absolute path
    • A. 

      Dir

    • B. 

      Ls

    • C. 

      Pwd

    • D. 

      Cd

    • E. 

      None of the above

  • 16. 
    Log in as root, and run the following commands: mkdir ~/test1 cd ~/test1 mkdir -p parent/child touch f1 f2 f3 cp f3 f4 mv f1 f2 f3 ./parent/child cp f4 ./parent/child/f5 cd parent cd ../../ pwd rmdir ~/test1/parent/child rm -r ~/test1/parent How many regular files are left in ~/test1 after executing the above commands??
    • A. 

      0

    • B. 

      1

    • C. 

      2

    • D. 

      3

    • E. 

      None of the above

  • 17. 
    Log in as root, and run the following commands: mkdir ~/test1 cd ~/test1 mkdir -p parent/child touch f1 f2 f3 cp f3 f4 mv f1 f2 f3 ./parent/child cp f4 ./parent/child/f5 cd parent cd ../../ pwd rmdir ~/test1/parent/child rm -r ~/test1/parent How many directories have been created (included deleted directories)?
    • A. 

      2

    • B. 

      3

    • C. 

      4

    • D. 

      5

    • E. 

      None of the above

  • 18. 
    Log in as root, and run the following commands: mkdir ~/test1 cd ~/test1 mkdir -p parent/child touch f1 f2 f3 cp f3 f4 mv f1 f2 f3 ./parent/child cp f4 ./parent/child/f5 cd parent cd ../../ pwd rmdir ~/test1/parent/child rm -r ~/test1/parent What is the output of pwd  command?
    • A. 

      /

    • B. 

      /root

    • C. 

      /root/test1/parent

    • D. 

      /root/test1

    • E. 

      None of the above

  • 19. 
    Log in as root, and run the following commands: mkdir ~/test1 cd ~/test1 mkdir -p parent/child touch f1 f2 f3 cp f3 f4 mv f1 f2 f3 ./parent/child cp f4 ./parent/child/f5 cd parent cd ../../ pwd rmdir ~/test1/parent/child rm -r ~/test1/parent How many directories have been successfully removed?
    • A. 

      0

    • B. 

      1

    • C. 

      2

    • D. 

      3

    • E. 

      None of the above

  • 20. 
    Which of the following are all valid basic file permissions under Linux?
    • A. 

      Read, Write, Hidden, Read Only, Execute

    • B. 

      Read, Hidden, Execute

    • C. 

      Read, System, Hidden, Archive

    • D. 

      Read, Write, Execute

    • E. 

      None of the above

  • 21. 
    What are the permissions in octal mode of the file fileone, given the file listing below: -rwxr-x-w- 2 steven studends   12 Feb 6 10:37 fileone
    • A. 

      421401001

    • B. 

      Rwxrw-r-x

    • C. 

      762

    • D. 

      752

    • E. 

      None of the above

  • 22. 
    Given the file permission  rw-r--r-- for a file names script1 , identify the chmod command that adds executable permissions for owner and group and removes read permission from others:
    • A. 

      Chmod 750 script1

    • B. 

      Chmod 760 script1

    • C. 

      Chmod 770 script1

    • D. 

      Chmod 754 script1

    • E. 

      None of the above

  • 23. 
    Given the file permission in octal mode 644 for a file named script2 , identify  chmod command that adds execut permissions for group and others: (SELECT ALL THAT APPLY)
    • A. 

      Chmod 655 script2

    • B. 

      Chmod g+x, o+x script2

    • C. 

      Chmod g=x,o=x script2

    • D. 

      Chmod u+x,g+x script2

    • E. 

      None of the above

  • 24. 
    Login as root, identify the Linux command used to give everyone full access permission to directory /public (select all that apply)
    • A. 

      Chmod 777 /public

    • B. 

      Chmod ugo=rwx /public

    • C. 

      Chmod a+rwx /public

    • D. 

      Chmod ugo+rwx /public

    • E. 

      Chmod a+rwx /public

  • 25. 
    Which of the following statements about minimum permissions needed to delete a file in Linux is true?
    • A. 

      For the directory: None, for the file : write(w) and execute(x)

    • B. 

      For the directory: write(w) and execute, for the file: none

    • C. 

      For the directory: read(r), write(w) and execute(x), for the file:none

    • D. 

      For the directory:read(r) and write(w), for the file: write(w)

    • E. 

      None of the above

Back to Top Back to top