Linux Certification Practice Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Lakshmoji
L
Lakshmoji
Community Contributor
Quizzes Created: 1 | Total Attempts: 811
| Attempts: 811
SettingsSettings
Please wait...
  • 1/79 Questions

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

    • Cp oldfile newfile
    • Ren oldfile newfile
    • Mv oldfile newfile
    • Touch oldfile newfile
    • None of the above
Please wait...
About This Quiz

This Linux Certification Practice quiz assesses key skills in file management, directory navigation, and command-line usage. It is designed for learners preparing for Linux certification, enhancing both fundamental and advanced Linux command knowledge.

Linux Certification Practice Quiz - Quiz

Quiz Preview

  • 2. 

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

    • Rm

    • Rm -r

    • Rmdir

    • Rmdir -p

    • None of the above

    Correct Answer
    A. Rm -r
    Explanation
    The correct answer is "rm -r" because the "rm" command is used to remove files and directories in Linux, and the "-r" option is used to remove directories and their contents recursively. Therefore, "rm -r" is the command that can be used to remove a directory with files in it in Linux.

    Rate this question:

  • 3. 

    Which of the following are all valid basic file permissions under Linux?

    • Read, Write, Hidden, Read Only, Execute

    • Read, Hidden, Execute

    • Read, System, Hidden, Archive

    • Read, Write, Execute

    • None of the above

    Correct Answer
    A. Read, Write, Execute
    Explanation
    The correct answer is "Read, Write, Execute". These are the three basic file permissions in Linux. The "Read" permission allows a user to view the contents of a file, the "Write" permission allows a user to modify the file, and the "Execute" permission allows a user to run the file as a program.

    Rate this question:

  • 4. 

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

    • Paul

    • Students

    • Root

    • Files dont have owners

    • None of the above

    • Devins mom

    Correct Answer
    A. Paul
    Explanation
    The owner of filetwo is "paul" because in the given file permission string "-rwxr-x-w-", the first character indicates the file type (in this case, it is a regular file), the next three characters "rwx" represent the permissions for the owner (paul), the next three characters "r-x" represent the permissions for the group (students), and the last three characters "-w-" represent the permissions for others.

    Rate this question:

  • 5. 

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

    • Echo $SHELL

    • Cat /etc/shells

    • Uname -r

    • Cat /etc/fstab

    • 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 variable, and "$SHELL" is a special variable that holds the name of the current shell being used. By executing this command, the name of the current shell will be printed on the console.

    Rate this question:

  • 6. 

    You use the ______ symbol to mark the beginning of a comment in a script.

    • #

    • $

    • !

    • >

    • None of the above

    Correct Answer
    A. #
    Explanation
    The correct answer is "#". In scripting, the "#" symbol is used to mark the beginning of a comment. Comments are lines of code that are not executed by the computer and are used to provide explanations or notes for the human reader.

    Rate this question:

  • 7. 

    Which of the following uses the bash shell for the command interpreter in a script?

    • /bin/bash

    • #/bin/bash

    • !/bin/bash

    • #!/bin/bash

    • None of the above

    Correct Answer
    A. #!/bin/bash
    Explanation
    The correct answer is "#!/bin/bash". This is because the "#!" symbol, also known as the shebang, is used to specify the interpreter for the script. In this case, "/bin/bash" is specified as the interpreter, indicating that the bash shell should be used to interpret the commands in the script.

    Rate this question:

  • 8. 

    The command find . -name practice would search from?

    • Root directory

    • Users home directory

    • Parent directory

    • Current directory

    • None of the above

    Correct Answer
    A. Current directory
    Explanation
    The command "find . -name practice" is used to search for files or directories with the name "practice" within the current directory. The "." represents the current directory, so the search will start from the current directory and search recursively through all subdirectories. Therefore, the correct answer is the current directory.

    Rate this question:

  • 9. 

    Identify the command that is used to delete an existing group in Linux

    • Groupdel

    • Gpasswd

    • Groupmod

    • Userdel

    • None of the above

    Correct Answer
    A. Groupdel
    Explanation
    The correct answer is "groupdel". In Linux, the "groupdel" command is used to delete an existing group. This command removes the specified group from the system, along with any associated files or directories owned by that group. The other options listed, such as "gpasswd", "groupmod", and "userdel", are not specifically used for deleting groups in Linux.

    Rate this question:

  • 10. 

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

    • Mv

    • Del

    • Rm

    • Rmdir

    • None of the above

    Correct Answer
    A. Rmdir
    Explanation
    The Linux command "rmdir" is used to delete a directory, but it can only delete a 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. Therefore, "rmdir" is the correct answer for this question.

    Rate this question:

  • 11. 

    __________ is the operator that is used when you want one command to execute only if another command executes successfully.

    • *

    • ||

    • &&

    • >

    • None of the above

    Correct Answer
    A. &&
    Explanation
    The correct answer is &&. The && operator is used in programming when you want one command to execute only if another command executes successfully. It is also known as the logical AND operator.

    Rate this question:

  • 12. 

    Identify the linux command used to display the inode number of /etc/fstab

    • Ls /etc/stab

    • Ls -l /etc/fstab

    • Ls -a /etc/fstab

    • Ls -i /etc/fstab

    • None of the above

    Correct Answer
    A. 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 file "/etc/fstab".

    Rate this question:

  • 13. 

    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

    • 421401001

    • Rwxrw-r-x

    • 762

    • 752

    • None of the above

    Correct Answer
    A. 752
    Explanation
    The file listing shows that the file fileone has the permissions -rwxr-x-w-. In octal mode, each permission is represented by a digit. The first digit represents the owner's permissions, the second digit represents the group's permissions, and the third digit represents the permissions for others. The permissions are assigned values as follows: read (4), write (2), and execute (1).

    For the owner, the permissions are rwx, which translates to 4+2+1=7 in octal mode.
    For the group, the permissions are r-x, which translates to 4+0+1=5 in octal mode.
    For others, the permissions are -w-, which translates to 0+2+0=2 in octal mode.

    Therefore, the octal mode permissions for the file fileone are 752.

    Rate this question:

  • 14. 

    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 _______.

    • Regular user

    • Root

    • Any user

    • None of the above

    Correct Answer
    A. Root
    Explanation
    To successfully mount /dev/cdrom, you should log on as root.

    Rate this question:

  • 15. 

    What is the file that stores encrypted user passwords?

    • /etc/passwd

    • /etc/group

    • /etc/shadow

    • /etc/inittab

    • None of the above

    Correct Answer
    A. /etc/shadow
    Explanation
    The file that stores encrypted user passwords is /etc/shadow. This file is commonly found in Unix-like operating systems and contains information about user accounts, including their hashed passwords. The passwords are stored in an encrypted format to enhance security and protect against unauthorized access. Access to this file is restricted to privileged users only, ensuring that sensitive password information remains confidential.

    Rate this question:

  • 16. 

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

    • :wq

    • :w

    • :q

    • :q!

    • None of the above

    Correct Answer
    A. :q!
    Explanation
    The correct answer is ":q!" because it is the command used to quit vim without saving any changes made to the file. The exclamation mark (!) is added to force the quit operation, discarding any unsaved modifications. The other options mentioned, such as ":wq" (write and quit), ":w" (write), ":q" (quit), and "none of the above" do not fulfill the requirement of quitting without saving.

    Rate this question:

  • 17. 

    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 __________?

    • /dev/sda1

    • /dev/sda2

    • /dev/sda3

    • /dev/sda5

    • None of the above

    Correct Answer
    A. /dev/sda3
    Explanation
    Based on the output of the fdisk -l command, the extended partition is /dev/sda3. This can be determined by looking at the "System" column, which shows that /dev/sda3 has a system ID of 5, indicating that it is an extended partition.

    Rate this question:

  • 18. 

    What special variable is used to determine the exit status of a previously executed command?

    • $#

    • $0

    • $?

    • $9

    • None of the above

    Correct Answer
    A. $?
    Explanation
    The special variable "$?" is used to determine the exit status of a previously executed command. It holds the value of the exit status, which is a number indicating whether the command was successful (usually 0) or if there was an error (usually a non-zero value). This variable is commonly used in shell scripting to check the success or failure of a command and make decisions based on it.

    Rate this question:

  • 19. 

    ____________ is the symbol used to separate commands in a list, which are executed sequentially.

    • ;

    • >

    • >>

    • &&

    • None of the above

    Correct Answer
    A. ;
    Explanation
    The symbol ";" is used to separate commands in a list, which are executed sequentially.

    Rate this question:

  • 20. 

    What must you type in order for child shells to be able to use functions created in the parent shell?

    • Env

    • Export -f

    • Set

    • Name of the function

    • None of the above

    Correct Answer
    A. Export -f
    Explanation
    To make functions created in the parent shell accessible to child shells, the "export -f" command must be typed. This command exports the function to the environment, allowing child shells to use it. The "env" command is used to display the current environment variables. The "set" command is used to set shell options and positional parameters. Typing the name of the function alone will not make it accessible to child shells.

    Rate this question:

  • 21. 

    What happens when you type the following command line at the given command prompt: user1@localhost : ~$ cd .

    • You remain in current directory

    • You change into the parent directory

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

    • You will create a directory name ".."

    • None of the above

    Correct Answer
    A. You remain in current directory
    Explanation
    When you type the command "cd ." in the given 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 it, so you remain in the current directory.

    Rate this question:

  • 22. 

    What is the output of the following? echo "$(pwd)"

    • Current directory

    • Pwd

    • 'pwd'

    • Syntax error

    • None of the above

    Correct Answer
    A. Current directory
    Explanation
    The given command "echo "$(pwd)"" will print the current directory path. The "$(pwd)" is a command substitution which will be replaced by the output of the "pwd" command, which stands for "print working directory". Therefore, the output of the command will be the current directory path.

    Rate this question:

  • 23. 

    Which command is used to change the ownership of a file in Linux?

    • Chmod

    • Chown

    • Chgrp

    • Ls

    Correct Answer
    A. Chown
    Explanation
    In Linux, the chown command is used to change the ownership of a file or directory. It allows you to assign a different owner and/or group to the file. The chmod command changes file permissions, while chgrp changes the group ownership. The ls command is used to list files and directories but does not modify ownership or permissions.

    Rate this question:

  • 24. 

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

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

    • "animal" is displayed

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

    • Nothing displays

    • None of the above

    Correct Answer
    A. "cat", "dog", and "bear" are displayed on separate lines
    Explanation
    The given code is a simple loop that iterates over the words "cat", "dog", and "bear" one by one. The echo command is used to display each word on a separate line. Therefore, the output will be "cat", "dog", and "bear" displayed on separate lines.

    Rate this question:

  • 25. 

    What do you type to pause your script for two seconds?

    • Sleep 2

    • Wait 2

    • Pause 2

    • Devins weiner is the size of a leprechauns pinky

    • None of the above

    Correct Answer
    A. Sleep 2
    Explanation
    The correct answer is "sleep 2". In programming, the "sleep" command is used to pause the execution of a script for a specified amount of time. In this case, "sleep 2" indicates that the script should pause for 2 seconds before continuing. The other options ("wait 2", "pause 2", and "none of the above") are not valid commands for pausing a script.

    Rate this question:

  • 26. 

    Which of the following commands can be used to verify if user has been created in the file system?

    • Ls /home

    • Ls /root

    • Cat /etc/passwd|grep user1

    • Cat /etc/group|grep user1

    • None of the above

    Correct Answer
    A. Cat /etc/passwd|grep user1
    Explanation
    The correct answer is "cat /etc/passwd|grep user1". This command allows us to view the contents of the /etc/passwd file, which contains information about all the users on the system. By using the grep command with the specific username "user1", we can search for that user's information in the file. If the user exists, their details will be displayed.

    Rate this question:

  • 27. 

    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$

    • Cd ./test1

    • Cd ../test1

    • Cd ../../test1

    • Cd ~/test1

    • Cd /home/user1/test1

    Correct Answer
    A. Cd ~/test1
    Explanation
    The correct answer is selecting "cd ~/test1" because the "~" character is a shorthand representation for the user's home directory. So, "cd ~/test1" will take the user to the test1 sub-directory of user1's home directory.

    Rate this question:

  • 28. 

    Identify the root user accounts home directory in Linux

    • /

    • /root/home

    • /home/root

    • /root

    • None of the above

    Correct Answer
    A. /root
    Explanation
    The correct answer is /root. In Linux, the root user is the superuser with administrative privileges. The root user's home directory is typically located at /root. This directory serves as the root user's default working directory and contains their personal configuration files and data.

    Rate this question:

  • 29. 

    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? 

    • /dev/sda1

    • /dev/sda2

    • /dev/sda3

    • /dev/fd0

    • /dev/cdrom

    Correct Answer
    A. /dev/sda3
    Explanation
    The device/partition that is not mounted automatically during startup is /dev/sda3. This is indicated by the "noauto" option in the /etc/fstab file, which means that it will not be mounted automatically at boot time.

    Rate this question:

  • 30. 

    Which of the following statements is used to display the length of the data value of the second element in an array named tests.

    • Echo ${tests}

    • Echo ${tests[1]}

    • Echo ${#tests[1]}

    • Echo $#{tests[1]}

    • None of the above

    Correct Answer
    A. Echo ${#tests[1]}
    Explanation
    The correct answer is "echo ${#tests[1]}". In Bash, the "#" symbol is used to get the length of a variable or array element. In this case, ${#tests[1]} will display the length of the data value of the second element in the array named "tests".

    Rate this question:

  • 31. 

    Identify the environment variable that defines primary prompt.

    • PS1

    • PS2

    • SHELL

    • HOME

    • None of the above

    Correct Answer
    A. PS1
    Explanation
    The correct answer is PS1. PS1 is an environment variable that defines the primary prompt in Unix-like operating systems. It allows users to customize the appearance of their command prompt by setting various parameters such as colors, display of username, hostname, current working directory, and more. By modifying the value of PS1, users can create personalized and informative prompts that suit their preferences and needs.

    Rate this question:

  • 32. 

    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?

    • 0

    • 1

    • 2

    • 3

    • None of the above

    Correct Answer
    A. 2
    Explanation
    Two directories have been successfully removed. The command "rmdir ~/test1/parent/child" removes the "child" directory, and the command "rm -r ~/test1/parent" removes the "parent" directory.

    Rate this question:

  • 33. 

    You use the _______ statement to display all the elements in an array named labs.

    • Echo ${labs}

    • Echo ${labs[0]}

    • Echo ${labs[*]}

    • Echo ${labs[#]}

    • None of the above

    Correct Answer
    A. Echo ${labs[*]}
    Explanation
    The correct answer is "echo ${labs[*]}". This is because the "${labs[*]}" syntax is used to display all the elements in an array named "labs". The "${labs}" syntax without the [*] will only display the first element in the array. The "${labs[0]}" syntax will also only display the first element in the array. The "${labs[#]}" syntax is not a valid syntax for displaying elements in an array.

    Rate this question:

  • 34. 

    Login as joot, to change to login shell to /bin/csh  for user1, you type ____________.

    • Useradd -s /bin/csh user1

    • Echo $SHELL

    • Usermod -s /bin/csh user1

    • $SHELL=/bin/csh user1

    • None of the above

    Correct Answer
    A. Usermod -s /bin/csh user1
    Explanation
    To change the login shell to /bin/csh for user1, the correct command is "usermod -s /bin/csh user1". This command modifies the user account settings and sets the login shell to /bin/csh for the user named user1.

    Rate this question:

  • 35. 

    To immediately shutdown and halt a Linux machien from command line, you should:

    • Log in as root and type: shutdown -h now

    • Log in as root and type: shutdown -r now

    • Log in as root and type: stop linux -1

    • Turn power off and walk away

    • None of the above

    Correct Answer
    A. Log in as root and type: shutdown -h now
    Explanation
    The correct answer is to log in as root and type "shutdown -h now". This command is used to shut down the Linux machine immediately. The "-h" option stands for halt, which means to power off the system after shutting down all processes. The "now" parameter indicates that the shutdown should happen immediately. By logging in as root, the user has the necessary permissions to execute this command.

    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 How many logical drives have been created?

    • 1

    • 2

    • 3

    • 4

    • None of the above

    Correct Answer
    A. 3
    Explanation
    Based on the output of fdisk -l /dev/sda, there are three logical drives that have been created. These drives are represented by /dev/sda1, /dev/sda2, and /dev/sda7. Each drive has a different start and end cylinder, as well as a different system type (Linux or Linux swap/Solaris). Therefore, the correct answer is 3.

    Rate this question:

  • 37. 

    The command that displays all mounted devices ________________.

    • Mount

    • Cat /etc/fstab

    • Fdisk -l

    • Fsck

    • None of the above

    Correct Answer
    A. Mount
    Explanation
    The command "mount" is used to display all mounted devices.

    Rate this question:

  • 38. 

    Is the following the correct way of having a loop exit if 'Q' or 'q' was entered? while [  #CHOICE = 'Q' ] || [ $CHOICE = 'q' ]

    • Yes

    • No

    • Devins mom?

    Correct Answer
    A. No
    Explanation
    The given code is not the correct way of having a loop exit if 'Q' or 'q' was entered. The correct way would be to use a conditional statement within the loop, such as an if statement, to check if the input is equal to 'Q' or 'q'. If it is, then the loop can be exited using a break statement.

    Rate this question:

  • 39. 

    Which of the following would not place you in your home directory?

    • Cd

    • Cd ~

    • Cd ~/username

    • Cd /home/username

    • None of the above

    Correct Answer
    A. Cd ~/username
    Explanation
    The command "cd ~/username" would not place you in your home directory. The "~" symbol represents the home directory, so "cd ~" would take you to your home directory. However, appending "/username" to it would take you to a subdirectory named "username" within your home directory, not the home directory itself. Therefore, this command would not place you in your home directory.

    Rate this question:

  • 40. 

    Which of the following commands deletes user1 from /etc/passwd and removes user1's home directory and any files stored in it?

    • Userdel user1

    • Userdel -r user1

    • Usermod -r user1

    • Usermod -d user1

    • None of the above

    Correct Answer
    A. Userdel -r user1
    Explanation
    The correct answer is "userdel -r user1". This command is used to delete a user account along with their home directory and any files stored in it. The "-r" option stands for "remove" and ensures that the user's home directory and its contents are deleted as well. The other options and commands mentioned do not include the "-r" option, so they would not remove the user's home directory and files.

    Rate this question:

  • 41. 

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

    • Cp dir1 dir2 dir3

    • Cp -r dir1 dir2 dir3

    • Cp --parent dir1 dir2 dir3

    • Cp -p dir1 dir2 dir3

    • None of the above

    Correct Answer
    A. Cp -r dir1 dir2 dir3
    Explanation
    The correct answer is "cp -r dir1 dir2 dir3". The "-r" option is used to copy directories recursively, meaning it copies all files and subdirectories within the specified directories. Therefore, this command will copy dir1, dir2, and their contents into dir3.

    Rate this question:

  • 42. 

    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)?

    • 2

    • 3

    • 4

    • 5

    • None of the above

    Correct Answer
    A. 3
    Explanation
    The command "mkdir ~/test1" creates the directory "test1". The command "mkdir -p parent/child" creates the directories "parent" and "child" inside "test1". So, two directories have been created. The command "rmdir ~/test1/parent/child" deletes the directory "child". The command "rm -r ~/test1/parent" deletes the directory "parent". So, two directories have been deleted. Therefore, the total number of directories created (including deleted directories) is 2 + 2 = 4.

    Rate this question:

  • 43. 

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

    • Mount, mkfs, fsck, fdisk

    • Fdisk, fsck, mkfs, mount

    • Fdisk, mkfs, fsck, mount

    • Fsck, fdisk, mount, mkfs

    • None of the above

    Correct Answer
    A. 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 a partition on the disk. Then, mkfs is used to create a file system on the partition. After that, fsck is used to check the file system for any errors. Finally, the partition is mounted to make it accessible for use.

    Rate this question:

  • 44. 

    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.

    • No partitions or logical drives can be created

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

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

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

    • None of the above

    Correct Answer
    A. One primarry partition and more than one logical drives can be created
    Explanation
    Based on the output of the fdisk command, it can be observed that there is one primary partition (/dev/sda1) and an extended partition (/dev/sda3) which contains logical drives (/dev/sda5, /dev/sda6, /dev/sda7). Therefore, the correct answer is that one primary partition and more than one logical drives can be created without deleting an existing partition or adding a new hard drive.

    Rate this question:

  • 45. 

    You can keep your preferred settings by creating a ________ file in vim.

    • Vimrc

    • Bashrc

    • Man

    • History

    Correct Answer
    A. Vimrc
    Explanation
    You can keep your preferred settings by creating a "vimrc" file in vim. The vimrc file is a configuration file for Vim that allows users to customize their preferred settings and key mappings. By creating and editing the vimrc file, users can personalize their Vim experience and make it more efficient and tailored to their needs.

    Rate this question:

  • 46. 

    Identify the command used to activate a swap partition

    • Fdisk -l

    • Swapon

    • Mkfs

    • Mkswap

    • None of the above

    Correct Answer
    A. Swapon
    Explanation
    The command "swapon" is used to activate a swap partition. This command is used in Linux systems to enable the swapping of data between the RAM and the swap space on the hard disk. By activating the swap partition with the "swapon" command, the system can utilize additional virtual memory when the physical memory (RAM) is running low.

    Rate this question:

  • 47. 

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

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

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

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

    • Nothing - syntax error

    • None of the above

    Correct Answer
    A. 5,4,3,2,1 displayed on separate lines
    Explanation
    The given code initializes the variable "g" with a value of 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 then decreases it by 1. This process continues until "g" becomes 0. Therefore, the output will be 5, 4, 3, 2, 1 displayed on separate lines.

    Rate this question:

  • 48. 

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

    • Echo $PATH

    • Set +C

    • Umask

    • Set -noclobber

    • None of the above

    Correct Answer
    A. Set -noclobber
    Explanation
    The correct answer is "set -noclobber". This command prevents you from accidentally overwriting a file when you redirect output to a file. By using this command, if the file already exists, it will not be overwritten and an error message will be displayed instead.

    Rate this question:

  • 49. 

    To redirect standard output and error of script1 to a file named outerr.txt, use the ___________ command.

    • Script1 1> outerr.txt

    • Script1 2> outerr.txt

    • Script1 &> outerr.txt

    • Script1 > /dev/null

    • None of the above

    Correct Answer
    A. Script1 &> outerr.txt
    Explanation
    The correct answer is "script1 &> outerr.txt". This command redirects both the standard output and error of script1 to a file named outerr.txt. The "&>" symbol is used to redirect both outputs simultaneously.

    Rate this question:

Quiz Review Timeline (Updated): Nov 25, 2024 +

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

  • Current Version
  • Nov 25, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 07, 2019
    Quiz Created by
    Lakshmoji
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.