Red Hat Enterprise Linux Essentials - 033

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 Panku
P
Panku
Community Contributor
Quizzes Created: 2 | Total Attempts: 906
Questions: 25 | Attempts: 723

SettingsSettingsSettings
Company Quizzes & Trivia

Answer the questions:


Questions and Answers
  • 1. 

    Which of the following run level reboot the machine?

    • A.

      0

    • B.

      4

    • C.

      2

    • D.

      6

    • E.

      1

    Correct Answer
    D. 6
    Explanation
    Run level 6 is the correct answer because it is specifically designated for rebooting the machine. In Unix-like operating systems, each run level has a specific purpose, and run level 6 is reserved for system reboot. When the system enters run level 6, it initiates the reboot process, shutting down all running processes and restarting the machine. The other run levels listed (0, 4, 2, and 1) have different purposes such as shutting down the system, multi-user mode, or single-user mode, but run level 6 is specifically used for rebooting.

    Rate this question:

  • 2. 

    If the file newdir/file2 does not exist but the directory newdir does exist, what is the effect of the following command? mv file1 newdir/file2

    • A.

      File1 will be moved to newdir and renamed file2.

    • B.

      File1 will be copied to newdir and named file2.

    • C.

      An error will be reported, as this is an invalid command.

    • D.

      Dont know

    Correct Answer
    A. File1 will be moved to newdir and renamed file2.
    Explanation
    The command "mv file1 newdir/file2" will move the file named "file1" to the directory "newdir" and rename it as "file2". This means that the original file "file1" will no longer exist in its original location and can now be found in the "newdir" directory with the new name "file2".

    Rate this question:

  • 3. 

    Consider the following command:[root@localhost ~]# echo $?0What does the output“0” indicates? 

    • A.

      “0” indicates that last command was unsuccessful.

    • B.

      “0” indicates that your current run level is 0.

    • C.

      “0” indicates that last command was successful.

    • D.

      “0” indicates that your current umask is set to 000.

    • E.

      “0” indicates that password is disabled for root.

    Correct Answer
    C. “0” indicates that last command was successful.
    Explanation
    The output "0" indicates that the last command was successful.

    Rate this question:

  • 4. 

    What type of files are typically in the /etc directory?

    • A.

      Configuration files.

    • B.

      Miscellaneous files.

    • C.

      Standard Linux commands.

    • D.

      All of the above.

    Correct Answer
    A. Configuration files.
    Explanation
    The /etc directory typically contains configuration files. These files store settings and parameters for various programs and services on a Linux system. They are used to customize the behavior and functionality of the system and its applications. Examples of configuration files commonly found in the /etc directory include network configuration files, user account settings, system startup scripts, and package manager configurations.

    Rate this question:

  • 5. 

    Consider the following command:[root@localhost ~]#  cat  /etc/passwd | grep root | cut -d: -f1,7 What will be the output?

    • A.

      Root.

    • B.

      /bin/bash.

    • C.

      Error.

    • D.

      Root:x:0:0:root:/root:/bin/bash.

    • E.

      Root: /bin/bash.

    Correct Answer
    E. Root: /bin/bash.
    Explanation
    The given command is using the "cat" command to display the contents of the "/etc/passwd" file. The output of this command is then piped "|" to the "grep" command, which searches for lines containing the word "root". The output of the "grep" command is then piped "|" to the "cut" command, which uses ":" as the delimiter and selects the first and seventh fields from each line. Therefore, the output will be "root: /bin/bash", which represents the username "root" and the shell "/bin/bash".

    Rate this question:

  • 6. 

    For the file reports.txt, which of the following commands would, ignoring case, extract every line containing the word "expense", the lines before and after each match, and print the relevant line numbers?

    • A.

      Grep -i expense reports.txt

    • B.

      Grep -A1 -B1 -n -i expense reports.txt

    • C.

      Grep --context=1 -N -i expense reports.txt

    • D.

      Grep -a1 -b1 -n -i expense reports.txt

    • E.

      Grep -i -v -n expense reports.txt

    Correct Answer
    B. Grep -A1 -B1 -n -i expense reports.txt
    Explanation
    The correct answer is "grep -A1 -B1 -n -i expense reports.txt". This command will search for the word "expense" in the file "reports.txt" while ignoring case. It will also print the line numbers of the relevant lines. Additionally, it will print the line before and after each match using the options -A1 and -B1 respectively.

    Rate this question:

  • 7. 

    Consider the following file:[root@localhost ~]# cat catscatcatalogconcatenatepolecatCatWhat will be the output when you fire the below command:sed  ‘s/[Cc]at$/dog/’ cats.

    • A.

      dog catalog condogenate poledog dog

    • B.

      cat dogalog condogenate poledog dog

    • C.

      dog$ dog$alog condog$enate poledog$ dog$

    • D.

      cat catalog concatenate poledog cat

    • E.

      dog catalog concatenate poledog dog

    Correct Answer
    E. dog catalog concatenate poledog dog
    Explanation
    The sed command is used to perform text transformations on a file. In this case, the command 's/[Cc]at$/dog/' is used to replace the word 'cat' or 'Cat' at the end of a line with the word 'dog'.

    The given file contains the following lines:
    - cat
    - catalog
    - concatenate
    - poledog
    - cat

    When the sed command is applied to this file, the word 'cat' at the end of the first line is replaced with 'dog'. The rest of the lines remain unchanged. Therefore, the output will be:
    - dog
    - catalog
    - concatenate
    - poledog
    - cat

    Rate this question:

  • 8. 

    Where is the configuration information for network interface eth0 stored?

    • A.

      /etc/network/eth0.cfg

    • B.

      /etc/network-scripts/eth0.cfg

    • C.

      /etc/sysconfig/network

    • D.

      /etc/sysconfig/network-scripts/ifcfg-eth0

    • E.

      /etc/network/eth0

    Correct Answer
    D. /etc/sysconfig/network-scripts/ifcfg-eth0
    Explanation
    The configuration information for network interface eth0 is stored in the file /etc/sysconfig/network-scripts/ifcfg-eth0.

    Rate this question:

  • 9. 

    In the file /etc/sysconfig/network-scripts/ifcfg-eth0, which variable is modified to the value "dhcp" in order to get the IP address automatically from DHCP server? (write the name of variable in capital letters only).

    Correct Answer
    BOOTPROTO
    Explanation
    The variable that needs to be modified to "dhcp" in order to get the IP address automatically from the DHCP server is BOOTPROTO.

    Rate this question:

  • 10. 

    How many fields (columns) are there in /etc/shadow and /etc/gshadow respectively?

    • A.

      4, 9

    • B.

      7, 4

    • C.

      4, 4

    • D.

      9, 4

    • E.

      9, 7

    Correct Answer
    D. 9, 4
    Explanation
    The correct answer is 9, 4. In the /etc/shadow file, there are 9 fields or columns, which include the username, encrypted password, last password change date, minimum password age, maximum password age, password warning period, password inactivity period, account expiration date, and reserved field. In the /etc/gshadow file, there are 4 fields or columns, which include the group name, encrypted password, list of group administrators, and list of group members.

    Rate this question:

  • 11. 

    Which of the following commands could be used to configure a system's date and time?

    • A.

      Date

    • B.

      Datetime

    • C.

      Timeconf

    • D.

      Time

    • E.

      Dateconf

    Correct Answer
    A. Date
    Explanation
    The correct answer is "date". The "date" command is commonly used in Unix-like operating systems to display or set the system's date and time. By running the "date" command with appropriate options and arguments, users can view the current date and time, as well as modify them to set a new date and time.

    Rate this question:

  • 12. 

    Consider the following scripts:echo "Enter the username:"read NAMEuseradd $NAMEecho $NAME | passwd $NAME --stdinWhat will be the password if I run the above script and enter the username as 'abc'?

    • A.

      Password will be generated automatically

    • B.

      Machine will ask to enter the password manually

    • C.

      Password will be abc

    • D.

      Password will be disabled

    • E.

      Password will be --stdin

    Correct Answer
    C. Password will be abc
    Explanation
    The password will be 'abc' because the script uses the 'useradd' command to create a new user and the 'passwd' command to set the password. The password is set to the value of the variable '$NAME', which is 'abc' in this case.

    Rate this question:

  • 13. 

    What command will be run by this sequence? [root@localhost ~]# !?cat

    • A.

      The most recent cat command.

    • B.

      The most recent command that has cat in the command name.

    • C.

      The most recent command that has cat somewhere on the command line.

    • D.

      The most recent command before the cat command.

    Correct Answer
    B. The most recent command that has cat in the command name.
    Explanation
    The given sequence [root@localhost ~]# !?cat will run the most recent command that has "cat" in the command name. This means that if there was a previous command that included "cat" in its name, the sequence will run that command.

    Rate this question:

  • 14. 

    Consider the following file:[root@localhost ~]# cat examplebAafced433152aWhat will be the output of below command? Why?cat example | sort | uniq -d

    • A.

      3, because 3 is repeated in the digit 33.

    • B.

      33, because 33 is the only two digit character in the whole file.

    • C.

      A, because A is the capital alphabet in the file.

    • D.

      A, because a is repeated twice.

    • E.

      A,3; because both a & 3 are repeated twice.

    Correct Answer
    D. A, because a is repeated twice.
    Explanation
    The correct answer is "a, because a is repeated twice." This is because the command "cat example | sort | uniq -d" is used to display the duplicate lines in the file "example". The output will be the lines that are repeated in the file, and in this case, the letter "a" is repeated twice.

    Rate this question:

  • 15. 

    In the following shell script, how many times will the date command run? for i in a b; do date; done

    • A.

      0

    • B.

      1

    • C.

      2

    • D.

      3

    • E.

      Script is wrong

    Correct Answer
    C. 2
    Explanation
    The date command will run 2 times in the given shell script. This is because the script uses a for loop to iterate through the values "a" and "b". For each iteration, the date command is executed, resulting in a total of 2 executions.

    Rate this question:

  • 16. 

    Which among the following file should be modified in order to make the permanent configuration to the vim editor?

    • A.

      Vimrc

    • B.

      .vimrc

    • C.

      .exrc

    • D.

      Exrc

    • E.

      Either .vimrc or .exrc

    Correct Answer
    E. Either .vimrc or .exrc
    Explanation
    To make permanent configurations to the vim editor, either the .vimrc or .exrc file should be modified. These files contain settings and customization options for the vim editor. Modifying either of these files allows users to set preferences such as key mappings, syntax highlighting, and other editor configurations. By making changes to these files, users can ensure that their preferred settings are applied every time they use the vim editor.

    Rate this question:

  • 17. 

    What umask setting wouls be required to give, when creating a directory, read/write/execute for yourself, read & execute for group but only execute for others?

    • A.

      022

    • B.

      026

    • C.

      751

    • D.

      157

    • E.

      024

    Correct Answer
    B. 026
    Explanation
    The umask setting determines the default permissions for newly created files and directories. In this case, a umask setting of 026 would be required. This means that when creating a directory, the owner would have read, write, and execute permissions (7), the group would have read and execute permissions (5), and others would have only execute permissions (6).

    Rate this question:

  • 18. 

    Consider a directory /root/dropzone. Which amongst the following permissions should be set up so that group and others can save files in the directory, but they cannot read the files that are there? Root must be able to read and write the directory.

    • A.

      Drw--wx-wx

    • B.

      Drwx--x--x

    • C.

      Drwx-w--w-

    • D.

      Drwxrwxrwx

    • E.

      Drwx-wx-wx

    Correct Answer
    E. Drwx-wx-wx
    Explanation
    The correct answer is "drwx-wx-wx". This permission setting allows the group and others to save files in the directory ("/root/dropzone") by having write access, but they cannot read the files that are already there as they do not have read access. Root, however, can still read and write to the directory as it has full permissions.

    Rate this question:

  • 19. 

    Write down the command to view the calendar of January 2010.

    Correct Answer
    cal 01 2010
    cal 1 2010
    Explanation
    The command "cal 01 2010" and "cal 1 2010" are both correct answers because they both specify the month and year (January 2010) to view the calendar. The "cal" command is used to display a calendar in the terminal, and the format for specifying the month and year is either with leading zeros (01) or without leading zeros (1).

    Rate this question:

  • 20. 

    Write down the file in which DNS configuration are made.

    Correct Answer
    /etc/resolv.conf
    Explanation
    The DNS configuration is made in the file "/etc/resolv.conf". This file contains information about the DNS servers that the system should use to resolve domain names to IP addresses. By editing this file, users can specify the DNS server addresses, search domains, and other DNS settings for their system.

    Rate this question:

  • 21. 

    Suppose you want to view the man page for the gshadow file format. How might you do that?

    • A.

      Man gshadow --file

    • B.

      Man 5 gshadow

    • C.

      Man gshadow format

    • D.

      Man gshadow

    • E.

      Man -f gshadow format

    Correct Answer
    B. Man 5 gshadow
    Explanation
    To view the man page for the gshadow file format, you would use the command "man 5 gshadow". The "man" command is used to display the manual pages for various commands and topics, and the number "5" specifies the section of the manual where the gshadow file format is documented. By typing this command, you can access the specific information about the gshadow file format.

    Rate this question:

  • 22. 

    What will the following command do:find -size 1024k exec rm -f {} \;

    • A.

      It will delete the file/s of exactly 1 mb

    • B.

      It will delete the file/s of size greater than 1 mb

    • C.

      It will delete the file/s of size smaller than 1 mb

    • D.

      The above command has error

    Correct Answer
    A. It will delete the file/s of exactly 1 mb
    Explanation
    The given command "find -size 1024k exec rm -f {} \;" is using the "find" command to search for files with a size of exactly 1 megabyte (1024 kilobytes) and then executing the "rm -f" command to delete those files. Therefore, the command will delete the file/s that are exactly 1 megabyte in size.

    Rate this question:

  • 23. 

    Choose the inappropriate option regarding the at and crontab.

    • A.

      At uses one-time jobs while crontab uses reccuring jobs.

    • B.

      The syntax for deleting jobs in at is the syntax for deleting jobs in crontab is

    • C.

      The syntax for creating jobs in at is the syntax for creating jobs in crontab is

    • D.

      We cannot edit jobs in at while jobs in crontab can be edited using crontab -e command.

    Correct Answer
    B. The syntax for deleting jobs in at is the syntax for deleting jobs in crontab is
  • 24. 

    What command will you type to install linux using CLI?

    • A.

      Linux

    • B.

      Text

    • C.

      Cli

    • D.

      Linux text

    • E.

      Linux cli

    Correct Answer
    D. Linux text
    Explanation
    To install Linux using the command line interface (CLI), you would type "linux text" in the command prompt. This command initiates the installation process in text mode, allowing you to install Linux without a graphical user interface (GUI). By using the "linux text" command, you can install Linux on a system that may not have the necessary hardware or resources to support a GUI-based installation.

    Rate this question:

  • 25. 

    In which of the following file can you set the default run-level?

    • A.

      /etc/runlevel

    • B.

      /etc/inittab

    • C.

      /etc/init

    • D.

      /etc/motd

    • E.

      /etc/initlevel

    Correct Answer
    B. /etc/inittab
    Explanation
    In the given options, the correct file to set the default run-level is /etc/inittab. This file is used by the init process to determine the default run-level for the system. It contains configuration information for initializing and controlling the system during the boot process.

    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
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 29, 2009
    Quiz Created by
    Panku

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.