








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
WGU D281 Linux Foundations - Udemy Section 2: Lesson 6 - Creating questions with complete verified solutions 2026 Scripts
Typology: Exams
1 / 14
This page cannot be seen from the preview
Don't miss anything!









Which of the following programs are web servers? (Choose two.) A. Apache HTTPD B. Postfix C. Curl D. Dovecot E. NGINX - ANSWER-AE What are the differences between hard disk drives and solid state disks? (Choose two.) A. Hard disks have a motor and moving parts, solid state disks do not. B. Hard disks can fail due to physical damage, while solid state disks cannot fail. C. Solid state disks can store many times as much data as hard disk drives. D. /dev/sda is a hard disk device while /dev/ssda is a solid state disk. E. Solid state disks provide faster access to stored data than hard disks. - ANSWER-AE Reverse DNS assigns hostnames to IP addresses. How is the name of the IP address 198.51.100. stored on a DNS server? A. In the A record for 165.100.51.198.ipv4.arpa. B. In the PTR record for 165.100.51.198.in-addr.arpa. C. In the RNAME record for 198-51-100-165.rev.arpa. D. In the ARPA record for 165.100.51.198.rev. E. In the REV record for arpa.in-addr.198.51.100.165. - ANSWER-B Which of the following types of bus can connect hard disk drives with the motherboard? A. The RAM bus B. The NUMA bus C. The CPU bus D. The SATA bus E. The Auto bus - ANSWER-D Members of a team already have experience using Red Hat Enterprise Linux. For a small hobby project, the team wants to set up a Linux server without paying for a subscription. Which of the following Linux distributions allows the team members to apply as much of their Red Hat Enterprise Linux knowledge as possible? A. Ubuntu Linux LTS B. Raspbian C. Debian GNU/Linux D. CentOS E. openSUSE - ANSWER-D
What information can be displayed by top? A. Existing files, ordered by their size. B. Running processes, ordered by CPU or RAM consumption. C. User accounts, ordered by the number of logins. D. User groups, ordered by the number of members. E. User accounts, ordered by the number of files. - ANSWER-B Which of the following commands can be used to resolve a DNS name to an IP address? A. dnsname B. dns C. query D. host E. iplookup - ANSWER-D Which of the following outputs comes from the command free? total used free shared buff/cached available - ANSWER-total used free shared buff/cached available What is true about the dmesg command? (Choose two.) A. It traces the execution of a command and shows each step the program carries out. B. It sends messages to the command lines of all current user sessions. C. It displays the content of the Linux kernel's ring buffer. D. It immediately outputs all new messages written to the system journal. E. It might not display older information because it was overwritten by newer information. Correct Answer: CE - ANSWER-CE Which of the following outputs could stem from the command last? A. 1 ls 2 cat text.txt 3 logout B. Password for user last changed at Sat Mar 31 16:38:57 EST 2018 C. Last login: Fri Mar 23 10:56:39 2018 from server.example.com D. EXT4-fs (dm-7): mounted filesystem with ordered data mode. Opts: (null) E. root tty2 Wed May 17 21:11 - 21:11 (00:00) - ANSWER-E What is the UID of the user root? A. 1 B. - C. 255 D. 65536 E. 0 - ANSWER-E Which permissions are set on a regular file once the permissions have been modified with the command chmod 654 file.txt? A. drw-r-xr-- B. d""wxr-x-- C. ""wxr-x--x D. ""rwxrw---x
D. tar work.tar < ./work/ E. tar work > work.tar - ANSWER-B Which of the following keys can be pressed to exit less? A. l B. x C. e D. q E.! - ANSWER-D The current directory contains the following file:-rwxr-xr-x 1 root root 859688 Feb 7 08: test.shGiven that the file is a valid shell script, how can this script be executed? (Choose two.) A. run test.sh B. ${test.sh} C. cmd ./test.sh D. ./test.sh E. bash test.sh - ANSWER-DE Which of the following commands sorts the output of the command export-logs? A. export-logs < sort B. export-logs > sort C. export-logs & sort D. export-logs | sort E. export-logs <> sort - ANSWER-B A directory contains the following files: a. txt b. txt c. cav What would be the output of the following shell script?for file in *.txt do echo $file done A. *.txt B. a b C. c.cav D. a.txt E. a. txt b. txt - ANSWER-E Which of the following commands will search for the file foo.txt under the directory /home? A. search /home ""file foo.txt B. search /home foo. txt
C. find /home "" file foo.txt D. find /home name foo.txt E. find /home foo.txt - ANSWER-D The current directory contains the following file:-rw-r""r"" 1 root exec 24551 Apr 2 12:36 test.shThe file contains a valid shell script, but executing this file using ./test.sh leads to this error: bash: ./test.sh: Permission deniedWhat should be done in order to successfully execute the script? A. The file's extension should be changed from .sh to .bin. B. The execute bit should be set in the file's permissions. C. The user executing the script should be added to the exec group. D. The SetUID bit should be set in the file's permissions E. The script should be run using #!./test. sh instead of ./test.sh. - ANSWER-B What is a Linux distribution? A. The Linux file system as seen from the root account after mounting all file systems. B. A bundling of the Linux kernel, system utilities and other software. C. The set of rules which governs the distribution of Linux kernel source code. D. An operating system based on Linux but incompatible to the regular Linux kernel. E. A set of changes to Linux which enable Linux to run on another processor architecture. - ANSWER-B Which package management tool is used in Red Hat-based Linux Systems? A. portage B. rpm C. apt-get D. dpkg E. packagectl - ANSWER-B Which of the following programs is a graphical editor for vector graphics? A. Python B. NGINX C. Samba D. Inkscape E. MySQL - ANSWER-D Where is the operating system of a Raspberry Pi stored? A. On the master device attached to the Raspberry Pi's IDE bus. B. On a read only partition on the Raspberry Pi's firmware, next to the BIOS. C. On a removable SD card which is put into the Raspberry Pi. D. On a Linux extension module connected to the Raspberry Pi's GPIO pins. E. On rewritable flash storage which is built into the Raspberry Pi. - ANSWER-C What is defined by a Free Software license? A. Details of the technical documentation each contributor has to provide. B. The programming languages which may be used to extend the licensed program. C. A complete list of libraries required to compile the licensed software.
Which of the following directories contains information, documentation and example configuration files for installed software packages? A. /usr/share/doc/ B. /etc/defaults/ C. /var/info/ D. /doc/ E. /usr/examples/ - ANSWER-A Which of the following commands adds the directory /new/dir/ to the PATH environment variable? A. $PATH=/new/dir: $PATH B. PATH=/new/dir: PATH C. export PATH=/new/dir: PATH D. export $PATH=/new/dir: $PATH E. export PATH=/new/dir: $PATH - ANSWER-E A user is currently in the directory /home/user/Downloads/ and runs the command ls ../Documents/Assuming it exists, which directory's content is displayed? A. /home/user/Documents/ B. /home/user/Documents/Downloads/ C. /home/user/Downloads/Documents/ D. /Documents/ E. /home/Documents - ANSWER-D A directory contains the following three files:texts 1.txttexts 2.txttexts 3.csvWhich command copies the two files ending in .txt to the /tmp/ directory? A. cp ??.txt /tmp/ B. cp *.txt /tmp/ C. cp. .txt /tmp/ D. cp ?.txt /tmp/ E. cp $?.txt /tmp/ - ANSWER-B FILL BLANK -When typing a long command line at the shell, what single character can be used to split a command across multiple lines? - ANSWER-\ backlash Which of the following DNS record types hold an IP address? (Choose two.) A. NS B. AAAA C. MX D. A E. CNAME - ANSWER-BD Which of the following values could be a process ID on Linux? A. /bin/bash B. 60b503cd-019e-4300-a7be-922f074ef5ce C. /sys/pid/9a
D. fff E. 21398 - ANSWER-E Which of the following is a protocol used for automatic IP address configuration? A. NFS B. LDAP C. SMTP D. DNS E. DHCP - ANSWER-E Which of the following devices represents a hard disk partition? A. /dev/ttyS B. /dev/sata C. /dev/part D. /dev/sda E. /dev/sda/p2 - ANSWER-D Which of the following statements regarding Linux hardware drivers is correct? A. Drivers are regular Linux programs which have to be run by the user who wants to use a device. B. Drivers are not used by Linux because the BIOS handles all access to hardware on behalf of Linux. C. Drivers are stored on their devices and are copied by the Linux kernel when a new device is attached D. Drivers are downloaded from the vendor's driver repository when a new device is attached. E. Drivers are either compiled into the Linux kernel or are loaded as kernel modules. - ANSWER-E What can be found in the /proc/ directory? A. One directory per installed program. B. One device file per hardware device. C. One file per existing user account. D. One directory per running process. E. One log file per running service. - ANSWER-D A new server needs to be installed to host services for a period of several years. Throughout this time, the server should receive important security updates from its Linux distribution.Which of the following Linux distributions meet these requirements? (Choose two.) A. Ubuntu Linux LTS B. Fedora Linux C. Debian GNU/Linux Unstable D. Ubuntu Linux non-LTS E. Red Hat Enterprise Linux - ANSWER-AE Which of the following directories must be mounted with read and write access if it resides on its own dedicated file system? A. /opt B. /lib C. /etc
C. Create a new user account. D. Create a new user group. E. Lock a user account. - ANSWER-BE What is true about the su command? A. It is the default shell of the root account. B. It can only be used by the user root. C. It runs a shell or command as another user. D. It changes the name of the main administrator account. E. It locks the root account in specific time frames. - ANSWER-C FILL BLANK -What parameter of ls prints a recursive listing of a directory's content? (Specify ONLY the option name without any values or parameters.) - ANSWER-ls -R Most commands on Linux can display information on their usage. How can this information typically be displayed? A. By running the command with the option /? or /??. B. By running the command with the option ?! or ?=!. C. By running the command with the option /doc or /documentation. D. By running the command with the option -h or --help. E. By running the command with the option -m or --manpage. - ANSWER-D Which of the following commands shows the absolute path to the current working directory? A. who B. cd .. C. pwd D. ls -l E. cd ~/home - ANSWER-C Which of the following commands output the content of the file Texts 2.txt? (Choose two.) A. cat 'Texts 2.txt' B. cat -- Texts 2.txt C. cat |Texts 2.txt| D. cat 'Texts\ 2.txt' E. cat Texts\ 2.txt - ANSWER-AE Which command displays file names only and no additional information? A. ls -a B. ls -lh C. ls -l D. ls -alh E. ls -nl - ANSWER-A What is the purpose of the PATH environment variable? A. It allows the execution of commands without the need to know the location of the executable. B. It increases security by preventing commands from running in certain locations.
C. It specifies the location of a user's home directory. D. It indicates the location of the default shell to be used when a user logs in. E. It contains the absolute path to the current directory. - ANSWER-A Which of the following commands sets the variable USERNAME to the value bob? A. set USERNAME bob B. $USERNAME==bob C. var USERNAME=bob D. USERNAME<=bob E. USERNAME=bob - ANSWER-E What command displays manual pages? (Specify ONLY the command without any path or parameters.) - ANSWER-MAN Which command copies the contents of the directory /etc/, including all sub-directories, to /root/? A. copy /etc /root B. cp -r /etc/* /root C. cp -v /etc/* /root D. rcp /etc/* /root E. cp -R /etc/. /root - ANSWER-B Which of the following commands puts the lines of the file data.csv into alphabetical order? A. a..z data.csv B. sort data.csv C. abc data.csv D. wc -s data.csv E. grep --sort data.csv - ANSWER-B Which of the following examples shows the general structure of a for loop in a shell script? A. for *.txt as file => echo $file B. for *.txt ( echo $i ) C. for file in *.txt do echo $i done D. for ls *.txt exec {} ; E. foreach @{file} { echo $i } - ANSWER-C Which operator in a regular expression matches the preceding character either zero or one time? A.? B. * C. + D. % E. $ - ANSWER-B The file script.sh in the current directory contains the following content:#!/bin/bashecho $MYVARThe following commands are used to execute this script:MYVAR=value -./script.shThe result is an empty line instead of the content of the variable MYVAR. How should MYVAR be set in order to make script.sh display the content of MYVAR?
C. Users cannot change their password once it has been set. D. Passwords are only stored in hashed form. E. Passwords may be at most six characters long. - ANSWER-D Which of the following Linux Distributions is derived from Red Hat Enterprise Linux? A. Raspbian B. openSUSE C. Debian D. Ubuntu E. CentOS - ANSWER-E Which of the following statements is true about Free Software? A. It is developed by volunteers only. B. It may be modified by anyone using it. C. It must always be available free of charge. D. It only runs on Linux. E. It is only distributed as a compiled binary. - ANSWER-B How is a new Linux computing instance provisioned in an laaS cloud? A. The standard Linux installer has to be run through a remote console. B. After buying a Linux distribution, its vendor delivers it to a cloud instance. C. The installation has to be prepared in a local virtual machine which is then copied to the cloud. D. The cloud hosting organization provides a set of pre-prepared images of popular Linux distributions. E. A provider-specific configuration file describing the desired installation is uploaded to the cloud provider. - ANSWER-D What are the differences between a private web browser window and a regular web browser window? (Choose three.) A. Private web browser windows do not allow printing or storing websites. B. Private web browser windows do not store cookies persistently. C. Private web browser windows do not support logins into websites. D. Private web browser windows do not keep records in the browser history. E. Private web browser windows do not send regular stored cookies. - ANSWER-BDE What is the preferred source for the installation of new applications in a Linux based operating system? A. The vendor's version management system B. A CD-ROM disk C. The distribution's package repository D. The vendor's website E. A retail store - ANSWER-C What information is stored in /etc/passwd? (Choose three correct answers.) A. The user's storage space limit B. The numerical user ID
C. The username D. The encrypted password E. The user\s default shell - ANSWER-BCE