How Much Do You Know About Linux? Trivia Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Golf_pro90
G
Golf_pro90
Community Contributor
Quizzes Created: 2 | Total Attempts: 373
Questions: 85 | Attempts: 122

SettingsSettingsSettings
How Much Do You Know About Linux? Trivia Quiz - Quiz


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

    Correct Answer(s)
    A. /
    B. /home/user/test1
    Explanation
    The paths "/","/home/user/test1" represent absolute paths in Linux. In Linux, an absolute path starts with a forward slash ("/") and specifies the complete directory structure from the root directory. The paths "./user/test1" and "../user/fstab" are not absolute paths because they start with a dot (".") or double dots (".."), indicating relative paths.

    Rate this question:

  • 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) user1@localhost: /bin$

    • A.

      Cd ./test1

    • B.

      Cd ../test1

    • C.

      Cd ../../test1

    • D.

      Cd ~/test1

    • E.

      Cd /home/user1/test1

    Correct Answer(s)
    D. Cd ~/test1
    E. Cd /home/user1/test1
    Explanation
    You can cd into test1 by using the commands cd ~/test1 or cd /home/user1/test1. The first command uses the ~ symbol to represent the user's home directory, and then appends /test1 to navigate to the sub-directory. The second command directly specifies the full path to the test1 directory.

    Rate this question:

  • 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

    Correct Answer
    B. Cp -r dir1 dir2 dir3
    Explanation
    The correct answer is "cp -r dir1 dir2 dir3" because the "-r" flag is used to copy directories recursively, meaning it will copy all the files and subdirectories within the directories dir1 and dir2 to dir3.

    Rate this question:

  • 4. 

    Identify the root user accounts home directory in Linux

    • A.

      /

    • B.

      /root/home

    • C.

      /home/root

    • D.

      /root

    • E.

      None of the above

    Correct Answer
    D. /root
    Explanation
    The root user in Linux has its home directory located at "/root". This is the default location where the root user's personal files and configurations are stored. The other options mentioned ("/", "/root/home", "/home/root") are incorrect as they do not represent the correct path to the root user's home directory.

    Rate this question:

  • 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

    Correct Answer
    C. Mv oldfile newfile
    Explanation
    The correct answer is "mv oldfile newfile". The "mv" command in Linux is used to move or rename files and directories. In this case, it renames the file named "oldfile" to "newfile" in the current working directory.

    Rate this question:

  • 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

    Correct Answer
    D. Set -noclobber
    Explanation
    The correct answer is "set -noclobber". This command is used in Linux to prevent accidental overwriting of a file when redirecting output to a file. By using this command, if a file already exists with the same name, the output will not overwrite it and an error message will be displayed instead.

    Rate this question:

  • 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

    Correct Answer
    D. Rmdir
    Explanation
    The correct answer is "rmdir". The "rmdir" command in Linux is used to remove a directory, but it can only delete the directory if it is empty. If the directory contains any files or subdirectories, the "rmdir" command will not work and will display an error message.

    Rate this question:

  • 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

    Correct Answer
    B. Rm -r
    Explanation
    The command "rm -r" is used to remove a directory with files in it in Linux. The "rm" command is used to remove files, and the "-r" option is used to remove directories recursively, meaning it will remove the directory and all its contents. Therefore, "rm -r" is the correct command to remove a directory with files in it.

    Rate this question:

  • 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

    Correct Answer
    A. Log in as root and type: shutdown -h now
    Explanation
    The correct answer is "Log in as root and type: shutdown -h now". This command is used to shutdown and halt a Linux machine immediately. The "-h" option stands for halt, and "now" indicates that the shutdown should happen immediately. Logging in as root is necessary to have the required privileges to execute this command.

    Rate this question:

  • 10. 

    Identify the environment variable that defines primary prompt.

    • A.

      PS1

    • B.

      PS2

    • C.

      SHELL

    • D.

      HOME

    • E.

      None of the above

    Correct Answer
    A. PS1
    Explanation
    The environment variable "PS1" defines the primary prompt in a Unix-like operating system. It specifies the format and content of the command prompt that appears when a user is ready to enter a command. By setting the value of "PS1", users can customize the appearance of their command prompt to suit their preferences or display additional information.

    Rate this question:

  • 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

    Correct Answer
    A. Echo $SHELL
    Explanation
    The correct answer is "echo $SHELL" because the "echo" command is used to display the value of a shell variable, and "$SHELL" is a built-in environment variable that holds the name of the current shell. By running this command, the name of the current shell will be displayed on the terminal.

    Rate this question:

  • 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

    Correct Answer
    C. Cd ~/username
    Explanation
    The command "cd ~/username" would not place you in your home directory. This command would attempt to change the directory to a subdirectory named "username" within the home directory. To go directly to the home directory, the correct command would be "cd" or "cd ~". The other options "cd" and "cd /home/username" would also take you to the home directory.

    Rate this question:

  • 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

    Correct Answer
    D. Ls -i /etc/fstab
    Explanation
    The correct answer is "ls -i /etc/fstab". The "-i" option is used with the "ls" command to display the inode number of a file or directory. In this case, it is used to display the inode number of the /etc/fstab file.

    Rate this question:

  • 14. 

    What happens when you type the following command line at the given command prompt: user1@localhost : ~$ 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

    Correct Answer
    A. You remain in current directory
    Explanation
    When you type the command "cd ." at the command prompt, it means you are trying to change the directory to the current directory itself. Since you are already in the current directory, there is no need to change directories, so you remain in the current directory.

    Rate this question:

  • 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

    Correct Answer
    B. Ls
    Explanation
    The correct answer is "ls" because the "ls" command in Linux is used to list the contents of a directory. Although it does not directly print the current working directory in absolute path, it can be used with additional options to achieve this. For example, using the "ls -d" command will display the current directory in absolute path format.

    Rate this question:

  • 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

    Correct Answer
    B. 1
    Explanation
    After executing the above commands, only one regular file, "f2", is left in the ~/test1 directory. All other regular files have either been moved or copied to the ~/test1/parent/child directory or deleted.

    Rate this question:

  • 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

    Correct Answer
    B. 3
    Explanation
    The correct answer is 3. The directories "test1", "parent", and "child" have been created. The "parent" directory is later deleted, but it was still created at some point. So, a total of 3 directories have been created.

    Rate this question:

  • 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

    Correct Answer
    B. /root
    Explanation
    The output of the "pwd" command is "/root". This is because the "cd ../.." command is used to navigate two directories up from the current directory, which is "/root/test1/parent". So, the final directory is "/root".

    Rate this question:

  • 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

    Correct Answer
    C. 2
    Explanation
    Two directories have been successfully removed: "child" and "parent". The "rmdir" command is used to remove empty directories, and the "rm -r" command is used to remove directories and their contents recursively. In this scenario, the "child" directory is removed using "rmdir" and the "parent" directory is removed using "rm -r".

    Rate this question:

  • 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

    Correct Answer
    D. Read, Write, Execute
    Explanation
    The correct answer is "Read, Write, Execute." These are the three basic file permissions under Linux. "Read" allows a user to view the contents of the file, "Write" allows a user to modify or delete the file, and "Execute" allows a user to run the file as a program. These permissions can be set separately for the owner of the file, the group that the file belongs to, and other users. The other options listed in the question either include invalid permissions or do not include all three basic permissions.

    Rate this question:

  • 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

    Correct Answer
    D. 752
    Explanation
    The file listing "-rwxr-x-w-" indicates that the owner has read, write, and execute permissions, the group has read and execute permissions, and others have write permissions. In octal mode, the permissions are represented as follows: read (4), write (2), and execute (1). Therefore, the owner has permissions 7 (4+2+1), the group has permissions 5 (4+1), and others have permissions 2 (2). Thus, the octal mode of the file fileone is 752.

    Rate this question:

  • 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

    Correct Answer
    A. Chmod 750 script1
    Explanation
    The given file permission "rw-r--r--" means that the owner has read and write permissions, the group has only read permission, and others have only read permission. To add executable permissions for the owner and group and remove read permission from others, we need to use the chmod command with the permissions "750". This means that the owner will have read, write, and execute permissions, the group will have read and execute permissions, and others will have no permissions. Therefore, the correct answer is "chmod 750 script1".

    Rate this question:

  • 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

    Correct Answer(s)
    A. Chmod 655 script2
    B. Chmod g+x, o+x script2
    Explanation
    The correct answer is "chmod 655 script2" because it adds execute permissions for the group and others. The octal mode 655 represents read, write, and execute permissions for the owner, read and write permissions for the group, and read and execute permissions for others. Additionally, "chmod g+x, o+x script2" is also correct as it explicitly adds execute permissions for the group and others. The other options do not add execute permissions for both group and others.

    Rate this question:

  • 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

    Correct Answer(s)
    A. Chmod 777 /public
    B. Chmod ugo=rwx /public
    C. Chmod a+rwx /public
    D. Chmod ugo+rwx /public
    E. Chmod a+rwx /public
    Explanation
    The Linux command used to give everyone full access permission to directory /public is "chmod 777 /public". Additionally, "chmod ugo=rwx /public", "chmod a+rwx /public", "chmod ugo+rwx /public", and "chmod a+rwx /public" are also correct commands to achieve the same result.

    Rate this question:

  • 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

    Correct Answer
    B. For the directory: write(w) and execute, for the file: none
    Explanation
    The minimum permissions needed to delete a file in Linux are write (w) and execute (x) for the directory and none for the file. This means that the user must have write and execute permissions on the directory where the file is located in order to delete it. However, no specific permissions are required for the file itself.

    Rate this question:

  • 26. 

    Given the following -rwxr-x-w- 2  paul students    127 Oct 5 13:37 filetwo Who is the owner of filetwo?

    • A.

      Paul

    • B.

      Students

    • C.

      Root

    • D.

      Files dont have owners

    • E.

      None of the above

    • F.

      Devins mom

    Correct Answer
    A. Paul
    Explanation
    The owner of the file "filetwo" is "paul" because "paul" is the first entry in the given file permissions string "-rwxr-x-w-".

    Rate this question:

  • 27. 

    Given the following: -rwxr-x-w- 2 students 127 Oct 5 13:37 filetwo which of the following is the right command to change filetwo's owner to jack?

    • A.

      Chmod paul jack

    • B.

      Chgrp jack paul

    • C.

      Chown jack filetwo

    • D.

      Chown filetwo jack

    • E.

      None of the above

    Correct Answer
    D. Chown filetwo jack
    Explanation
    The correct command to change filetwo's owner to jack is "chown filetwo jack".

    Rate this question:

  • 28. 

    Given the following: -rwxr-x-w- 2 students 127 Oct 5 13:37 filetwo to change the group students  to  faculty, you type _________________(SELECT ALL THAT APPLY)

    • A.

      Chown .faculty filetwo

    • B.

      Chmod jack.faculty filetwo

    • C.

      Chgrp faculty filetwo

    • D.

      Chgrp filetwo faculty

    • E.

      None of the above

    Correct Answer(s)
    B. Chmod jack.faculty filetwo
    C. Chgrp faculty filetwo
    Explanation
    To change the group "students" to "faculty" for the file "filetwo", you would use the command "chgrp faculty filetwo". The command "chown .faculty filetwo" is incorrect as it changes the owner, not the group. The command "chmod jack.faculty filetwo" is incorrect as it is not a valid command. The command "chgrp filetwo faculty" is incorrect as the order of the arguments is incorrect. Therefore, the correct answer is "chgrp faculty filetwo".

    Rate this question:

  • 29. 

    What a umask of 066, which will be the default file permission?

    • A.

      Rw-------

    • B.

      ----wx-wx

    • C.

      Rw--wx-wx

    • D.

      Rwxrw-r--

    • E.

      None of the above

    Correct Answer
    A. Rw-------
    Explanation
    A umask of 066 means that the default file permission will be rw-------. This means that the owner of the file will have read and write permissions, while all other users will have no permissions at all.

    Rate this question:

  • 30. 

    What is the order of execution to prepare a partition for data storage in Linux?

    • A.

      Mount, mkfs, fsck, fdisk

    • B.

      Fdisk, fsck, mkfs, mount

    • C.

      Fdisk, mkfs, fsck, mount

    • D.

      Fsck, fdisk, mount, mkfs

    • E.

      None of the above

    Correct Answer
    C. Fdisk, mkfs, fsck, mount
    Explanation
    The correct order of execution to prepare a partition for data storage in Linux is fdisk, mkfs, fsck, mount. First, fdisk is used to create and manage partitions on the disk. Then, mkfs is used to create a file system on the partition. After that, fsck is used to check and repair the file system for any errors. Finally, mount is used to mount the partition and make it accessible for data storage.

    Rate this question:

  • 31. 

    To set default directory permission to rwx-wx-wx, you should set umask to _______.

    • A.

      022

    • B.

      622

    • C.

      044

    • D.

      644

    • E.

      None of the above

    Correct Answer
    C. 044
    Explanation
    To set the default directory permission to rwx-wx-wx, the umask value should be set to 044. Umask is a value that is subtracted from the default permissions to determine the final permissions of newly created files and directories. In this case, the default permissions are 777 (rwxrwxrwx), and when the umask value of 044 is subtracted, it results in the desired permissions of 733 (rwx-wx-wx) for directories.

    Rate this question:

  • 32. 

    Which of the following is true about hard link in Linux (SELECT ALL THAT APPLY)

    • A.

      You may create multiple hard links to the same file

    • B.

      All hard links have the same inode number as the original files

    • C.

      All hard links become meaninless (orphan link) if the original file is removed

    • D.

      The physical file will not be removed from the disk until all hard links are deleted

    • E.

      None of the above

    Correct Answer(s)
    A. You may create multiple hard links to the same file
    B. All hard links have the same inode number as the original files
    D. The pHysical file will not be removed from the disk until all hard links are deleted
    Explanation
    Hard links in Linux allow multiple file names to be associated with the same inode, or index node, which contains the metadata and location of the file's data on the disk. Therefore, you can create multiple hard links to the same file, and all hard links will have the same inode number as the original file. If the original file is removed, the hard links will still point to the same data, but they will become meaningless or orphan links. The physical file will not be removed from the disk until all hard links are deleted. Therefore, the correct answer is that you may create multiple hard links to the same file, all hard links have the same inode number as the original files, and the physical file will not be removed from the disk until all hard links are deleted.

    Rate this question:

  • 33. 

    Answer based on the output of fdisk -l /dev/sda: Disk /dev/sda: 16/1 GB, 16106127360 bytes 255 heads, 63 sectors/track, 1958 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device        Boot          Start        End           Blocks                     Id          System /dev/sda1     *                 1            1657           13309821                83           Linux /dev/sda2                      1658        1912           2048284+               82           Linux swap/Solaris /dev/sda3                      1913        1929           56227+                   5             Extended /dev/sda5                      1913         1914          16033+                   82            Linux swap/Solaris /dev/sda6                      1915         1916          16033+                   83           Linux /dev/sda7                      1917        1919           24066                     83           Linux Identify whether new partitions or logical drives can be created without deleting an existing partition or adding a new hard drive.

    • A.

      No partitions or logical drives can be created

    • B.

      A partition can be created, and it has to be a primary partition

    • C.

      A partition can be created, and it has to be extented partition

    • D.

      One primarry partition and more than one logical drives can be created

    • E.

      None of the above

    Correct Answer
    D. One primarry partition and more than one logical drives can be created
    Explanation
    Based on the output of fdisk -l /dev/sda, it can be determined that one primary partition and more than one logical drives can be created without deleting an existing partition or adding a new hard drive. This is indicated by the presence of the extended partition (/dev/sda3) and the logical drives (/dev/sda5, /dev/sda6, /dev/sda7) within it. The extended partition allows for the creation of multiple logical drives within it, while the primary partition (/dev/sda1) can also be used to create another partition. Therefore, the correct answer is "One primary partition and more than one logical drives can be created."

    Rate this question:

  • 34. 

    Answer based on the output of fdisk -l /dev/sda: Disk /dev/sda: 16/1 GB, 16106127360 bytes 255 heads, 63 sectors/track, 1958 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device                Boot        Start              End            Blocks            Id                        System /dev/sda1             *               1                 1657            13309821       83                        Linux /dev/sda2                           1658             1912             2048284+      82                        Linux swap/Solaris /dev/sda3                           1913             1929             56227+          5                          Extended /dev/sda5                           1913             1914             16033+          82                        Linux swap/Solaris /dev/sda6                           1915             1916             16033+          83                        Linux /dev/sda7                           1917             1919             24066            83                        Linux List all primary partitions

    • A.

      /dev/sda1, /dev/sda2

    • B.

      /dev/sda1, /dev/sda2, /dev/sda3

    • C.

      /dev/sda5, /dev/sda6, /dev/sda7

    • D.

      /dev/sda3

    • E.

      None of the above

    Correct Answer
    A. /dev/sda1, /dev/sda2
    Explanation
    The correct answer is /dev/sda1, /dev/sda2. This is because the output of the fdisk -l /dev/sda command shows two partitions with the boot flag set, which indicates that they are primary partitions. These partitions are /dev/sda1 and /dev/sda2.

    Rate this question:

  • 35. 

    Answer based on the output of fdisk -l /dev/sda: Disk /dev/sda: 16/1 GB, 16106127360 bytes 255 heads, 63 sectors/track, 1958 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device               Boot                Start               End                   Blocks                Id               System /dev/sda1            *                        1                 1657                   13309821           83                Linux /dev/sda2                                   1658             1912                    2048284+          82                Linux swap/Solaris /dev/sda3                                   1913             1929                    56227+              5                  Extended /dev/sda5                                   1913             1914                   16033+               82                Linux swap/Solaris /dev/sda6                                   1915             1916                   16033+              83                 Linux /dev/sda7                                   1917             1919                   24066                83                 Linux How many logical drives have been created?

    • A.

      1

    • B.

      2

    • C.

      3

    • D.

      4

    • E.

      None of the above

    Correct Answer
    C. 3
    Explanation
    Based on the output of fdisk -l /dev/sda, there are three logical drives that have been created. This can be determined by looking at the number of partitions listed under the "System" column. In this case, there are three partitions listed: /dev/sda1, /dev/sda2, and /dev/sda5. Each of these partitions represents a logical drive that has been created. Therefore, the correct answer is 3.

    Rate this question:

  • 36. 

    Answer based on the output of fdisk -l /dev/sda: Disk /dev/sda: 16/1 GB, 16106127360 bytes 255 heads, 63 sectors/track, 1958 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device                     Boot                   Start                    End                 Blocks                Id                 System /dev/sda1                   *                         1                       1657                 13309821           83                  Linux /dev/sda2                                           1658                   1912                  2048284+          82                  Linux swap/Solaris /dev/sda3                                           1913                   1929                  56227+              5                    Extended /dev/sda5                                           1913                   1914                  16033+             82                   Linux swap/Solaris /dev/sda6                                           1915                   1916                  16033+             83                   Linux /dev/sda7                                           1917                   1919                  24066               83                   Linux The extended partition is __________?

    • A.

      /dev/sda1

    • B.

      /dev/sda2

    • C.

      /dev/sda3

    • D.

      /dev/sda5

    • E.

      None of the above

    Correct Answer
    C. /dev/sda3
    Explanation
    Based on the output of the fdisk command, the extended partition is /dev/sda3. This can be determined by looking at the "System" column, where the partition with the "Extended" system type is labeled as /dev/sda3.

    Rate this question:

  • 37. 

    Identify the command used to activate a swap partition

    • A.

      Fdisk -l

    • B.

      Swapon

    • C.

      Mkfs

    • D.

      Mkswap

    • E.

      None of the above

    Correct Answer
    B. Swapon
    Explanation
    The command used to activate a swap partition is "swapon". This command is used to enable swapping on a specified swap device or file. By using the "swapon" command, the system will start using the swap space allocated in the swap partition, allowing for efficient memory management and improving overall system performance.

    Rate this question:

  • 38. 

    What is the command that is used to create a swap filesystem.

    • A.

      Mkfs

    • B.

      Fdisk

    • C.

      Mke2fs

    • D.

      Mkswap

    • E.

      None of the above

    Correct Answer
    A. Mkfs
    Explanation
    The command "mkfs" is used to create a file system on a disk or a partition. However, in this question, the requirement is to create a swap filesystem. The correct command to create a swap filesystem is "mkswap". Therefore, the correct answer is "mkswap".

    Rate this question:

  • 39. 

    The command that displays all mounted devices ________________.

    • A.

      Mount

    • B.

      Cat /etc/fstab

    • C.

      Fdisk -l

    • D.

      Fsck

    • E.

      None of the above

    Correct Answer
    A. Mount
    Explanation
    The correct answer is "mount" because the "mount" command is used to display all mounted devices on a system. This command allows the user to see the file systems that are currently mounted and their corresponding mount points.

    Rate this question:

  • 40. 

    Based on /etc/fstab: /dev/sda1                     /                        ext3                defaults                              1    1 /dev/sda2                     swap                swap              defaults                              0    0 /dev/sda3                    /mnt/new          ext3                noauto                                2    2 /dev/fd0                      /mnt/floppy       ext2                auto, users                         0    0 /dev/cdrom                /mnt/cdrom       iso9660          auto, nouser                       0    0 To successfully mount /dev/cdrom , you should log on as _______.

    • A.

      Regular user

    • B.

      Root

    • C.

      Any user

    • D.

      None of the above

    Correct Answer
    B. Root
    Explanation
    To successfully mount /dev/cdrom, you should log on as root. Mounting a device requires administrative privileges, which are typically only granted to the root user.

    Rate this question:

  • 41. 

    Based on /etc/fstab: /dev/sda1           /                    ext3                  defaults              1     1 /dev/sda2         swap              swap                defaults               0     0 /dev/sda3         /mnt/new       ext3                  noauto                 2     2 /dev/fd0           /mnt/floppy    ext2                  auto, users          0     0 /dev/cdrom     /mnt/cdrom    iso9660            auto, nouser        0     0 Identify the correct command line that is used to mount /dev/sda3  ___________ (SELECT ALL THAT APPLY)

    • A.

      Mount /dev/sda3

    • B.

      Mount /mnt/new

    • C.

      Umount /mnt/new /dev/sda3

    • D.

      Mount -t

    • E.

      None of the above

    Correct Answer(s)
    A. Mount /dev/sda3
    B. Mount /mnt/new
    Explanation
    The correct command line that is used to mount /dev/sda3 is "mount /dev/sda3" and "mount /mnt/new". These commands will mount the /dev/sda3 partition and the /mnt/new directory respectively. The other options are not correct because "umount /mnt/new /dev/sda3" is the command to unmount the /mnt/new directory from the /dev/sda3 partition, and "mount -t" is an incomplete command.

    Rate this question:

  • 42. 

    Based on /etc/fstab: /dev/sda1               /                    ext3                   defaults         1 1 /dev/sda2             swap              swap                 defaults          0 0 /dev/sda3             /mnt/new       ext3                   noauto            2 2 /dev/fd0               /mnt/floppy    ext2                   auto, users     0 0 /dev/cdrom         /mnt/cdrom    iso9660             auto, nouser   0 0 Which device/partition is not mounted automatically during startup? 

    • A.

      /dev/sda1

    • B.

      /dev/sda2

    • C.

      /dev/sda3

    • D.

      /dev/fd0

    • E.

      /dev/cdrom

    Correct Answer
    C. /dev/sda3
    Explanation
    The device/partition that is not mounted automatically during startup is /dev/sda3. This is indicated by the "noauto" option specified in the /etc/fstab file for that device/partition.

    Rate this question:

  • 43. 

    To search a string "test2" in the BACKWARD direction in vim,  you type __________

    • A.

      /test2

    • B.

      ?test2

    • C.

      %test2

    • D.

      S/test2

    • E.

      None of the above

    Correct Answer
    B. ?test2
    Explanation
    In Vim, to search for a string in the backward direction, you use the "?" command followed by the string you want to search for. So, the correct answer is "?test2".

    Rate this question:

  • 44. 

    The command used to delete all characters from the cursor position to the end of the line in vim is ________

    • A.

      Dd

    • B.

      D$

    • C.

      Dw

    • D.

      D^

    • E.

      None of the above

    Correct Answer
    B. D$
    Explanation
    The command "d$" is used to delete all characters from the cursor position to the end of the line in vim.

    Rate this question:

  • 45. 

    What is the command used to quit without saving in vim?

    • A.

      :wq

    • B.

      :w

    • C.

      :q

    • D.

      :q!

    • E.

      None of the above

    Correct Answer
    D. :q!
    Explanation
    The command ":q!" is used to quit Vim without saving any changes made to the file. It forcefully exits the editor and discards any unsaved modifications.

    Rate this question:

  • 46. 

    The following will execute _______ time(s) for ((num=1; num<=5; num++)) do echo $num done

    • A.

      0

    • B.

      1

    • C.

      4

    • D.

      5

    • E.

      None of the above

    Correct Answer
    D. 5
    Explanation
    The given code is a for loop that starts with num=1 and continues until num is less than or equal to 5. In each iteration of the loop, the value of num is printed using the echo command. Since the loop starts with num=1 and continues until num=5, it will execute 5 times. Therefore, the correct answer is 5.

    Rate this question:

  • 47. 

    What is the result? for animal in cat dog bear do echo $animal done

    • A.

      The words "cat", "dog", "animal", and "bear" are displayed on one line

    • B.

      "animal" is displayed

    • C.

      "cat", "dog", and "bear" are displayed on separate lines

    • D.

      Nothing displays

    • E.

      None of the above

    Correct Answer
    C. "cat", "dog", and "bear" are displayed on separate lines
    Explanation
    The correct answer is "cat", "dog", and "bear" are displayed on separate lines. This is because the given code is a loop that iterates through the words "cat", "dog", and "bear" one by one and prints each word on a separate line using the "echo" command. Therefore, the output will be "cat", "dog", and "bear" displayed on separate lines.

    Rate this question:

  • 48. 

    The following will execute _____ time(s) ((t=0)) while [ $t -eq 10 ] || [ $t -ge 0 ] do echo "blue ocean!" done

    • A.

      0

    • B.

      1

    • C.

      2

    • D.

      Inifinite

    • E.

      None of the above

    Correct Answer
    D. Inifinite
    Explanation
    The given code will execute an infinite number of times because the condition in the while loop is always true. The variable t is initialized to 0, and the condition checks if t is equal to 10 or greater than or equal to 0. Since t is initially 0 and the condition only checks if t is equal to 10 or greater than 0, the condition will always be true and the loop will continue indefinitely.

    Rate this question:

  • 49. 

    What is the result of the following statements? ((g=5)) until [ $g -lt 1 ] do           echo $g          ((g--)) done

    • A.

      5,4,3,2,1 displayed on separate lines

    • B.

      5,4,3,2 displayed on separate lines

    • C.

      4,3,2,1,0 displayed on separate lines

    • D.

      Nothing - syntax error

    • E.

      None of the above

    Correct Answer
    A. 5,4,3,2,1 displayed on separate lines
    Explanation
    The given code initializes the variable "g" to 5. Then, it enters a loop that continues until the value of "g" is less than 1. Inside the loop, it prints the value of "g" and decrements it by 1. This process continues until "g" becomes 0. Therefore, the result of the code is that the numbers 5, 4, 3, 2, and 1 are displayed on separate lines.

    Rate this question:

  • 50. 

    What value of the variable name total will be displayed after executing the following statements? ((total=0)) for ((num1=1; num1<=3; num++)) do         for ((num2=1; num2<=2; num2++))         do                    for ((num3=10; num3 >=1; num--))                        ((total++))                        done            done done echo $total

    • A.

      20

    • B.

      30

    • C.

      60

    • D.

      120

    • E.

      None of the above

    Correct Answer
    C. 60
    Explanation
    The value of the variable total will be 60. This is because the nested loops are executed multiple times. The outer loop runs 3 times, the middle loop runs 2 times, and the inner loop runs 10 times. Each time the innermost loop runs, the total variable is incremented by 1. So, the total variable will be incremented 3 * 2 * 10 = 60 times.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Feb 06, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 17, 2012
    Quiz Created by
    Golf_pro90
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.