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.)
Ubuntu Linux LTS
Fedora Linux
Debian GNU/Linux Unstable
Ubuntu Linux non-LTS
Red Hat Enterprise Linux
Ubuntu Linux LTS and Red Hat Enterprise Linux are two Linux distributions that meet the requirements of hosting services for a period of several years and receiving important security updates from their Linux distribution. LTS stands for Long Term Support, which means that these versions of Ubuntu Linux are supported by Canonical, the company behind Ubuntu, for five years with security patches, bug fixes, and software updates1. Red Hat Enterprise Linux is a commercial Linux distribution that offers a stable and secure platform for enterprise applications, with a 10-year life cycle and regular security updates from Red Hat, the company behind RHEL2. Fedora Linux, Debian GNU/Linux Unstable, and Ubuntu Linux non-LTS are not suitable for the requirements, because they have shorter support cycles and are more focused on providing the latest features and software versions, rather than stability and security. Fedora Linux releases a new version every six months and each version is supported for 13 months3. Debian GNU/Linux Unstable is the development branch of Debian, which is constantly updated with new packages and changes, but is not intended for production use4. Ubuntu Linux non-LTS releases a new version every six months and each version is supported for nine months1. References:
Which of the following commands sorts the output of the commandexport-logs?
export-logs < sort
export-logs > sort
export-logs & sort
export-logs | sort
export-logs <> sort
The sort command is used to sort the lines of a text file or the output of another command in alphabetical, numerical, or other order. The sort command has the following syntax: sort [options] [file…]. The file argument is the name of one or more files to be sorted. If no file is given, the sort command reads from the standard input, which is usually the keyboard or the output of another command.
The | (pipe) symbol is used to connect the output of one command to the input of another command. This allows the creation of pipelines of commands that process data sequentially. The pipe symbol has the following syntax: command1 | command2. The command1 argument is the name of the first command, whose output is sent to the input of the second command. The command2 argument is the name of the second command, which receives the output of the first command as its input.
Therefore, the command export-logs | sort sorts the output of the export-logs command in alphabetical order. The export-logs command is assumed to be a custom command that exports some logs to the standard output. The sort command receives the output of the export-logs command as its input and sorts it according to the default criteria, which is the first character of each line. The sorted output is then displayed on the screen or can be redirected to a file or another command.
The other options in the question are incorrect because they use the wrong symbols to connect the commands. The < (input redirection) symbol is used to read the input of a command from a file instead of the keyboard. The > (output redirection) symbol is used to write the output of a command to a file instead of the screen. The & (background) symbol is used to run a command in the background, which means the command does not wait for user input and allows the user to run other commands simultaneously. The <> (bidirectional redirection) symbol is used to read and write the input and output of a command from and to the same file. None of these symbols can be used to sort the output of the export-logs command. References:
What is the UID of the user root?
1
-1
255
65536
0
The UID of the user root is always 0 on Linux systems. This is because the kernel uses the UID 0 to check for the superuser privileges and grant access to all system resources. The name of the user account with UID 0 is usually root, but it can be changed or have aliases. However, some applications may expect the name root and not work properly with a different name. The UID 0 is reserved for the root user and cannot be assigned to any other user. The UID 0 is stored in the /etc/passwd file along with other user information. References:
Which of the following statements are true regarding a typical shell script? (Choose two.)
It has the executable permission bit set.
It starts with the two character sequence #!.
It is located in /usr/local/scripts/.
It is located in /etc/bash/scripts/.
It is compiled into a binary file compatible with the current machine architecture.
A typical shell script is a text file that contains a series of commands or instructions that can be executed by a shell interpreter. A shell script usually has the executable permission bit set, which means that it can be run as a program by the user or another program. A shell script also starts with the two character sequence #!, which is called a shebang or a hashbang. This sequence tells the operating system which shell interpreter to use to run the script. For example, #!/bin/bash indicates that the script should be run by the bash shell. References:
Which of the following devices represents a hard disk partition?
/dev/ttyS0
/dev/sata0
/dev/part0
/dev/sda2
/dev/sda/p2
Section: (none)
The correct device name that represents a hard disk partition is /dev/sda2. This device name follows the Linux convention for naming hard disk devices and partitions. According to this convention123:
Therefore, /dev/sda2 means the second partition on the first serial drive, which is a valid hard disk partition. The other options are not valid hard disk partitions, because they do not follow the Linux convention. For example:
References: 1: Hard drive/device partition naming convention in Linux - Unix & Linux Stack Exchange 2: Hard drive partition naming convention in Linux - Ask Ubuntu 3: C.4. Device Names in Linux - Debian 4: What is /dev/ttyS0? - Quora
Explanation
A directory contains the following three files:
texts 1.txt
texts 2.txt
texts 3.csv
Which command copies the two files ending in.txtto the/tmp/directory?
cp ??.txt /tmp/
cp *.txt /tmp/
cp. \.txt /tmp/
cp ?.txt /tmp/
cp $?.txt /tmp/
The correct command to copy the two files ending in .txt to the /tmp/ directory is cp *.txt /tmp/. This command uses the wildcard character * to match any number of characters beforethe .txt extension. Therefore, it will copy both texts 1.txt and texts 2.txt to the destination directory /tmp/. The other options are incorrect because they use different wildcard characters or syntax that do not match the desired files. For example, option A uses ?? to match exactly two characters before the .txt extension, but the files have a space and a number, which are not considered as one character. Option C uses a backslash \ to escape the dot . before the .txt extension, but this is unnecessary and will cause the command to fail. Option D uses ? to match exactly one character before the .txt extension, but the files have more than one character. Option E uses $? to match the exit status of the previous command before the .txt extension, but this is not relevant and will cause the command to fail123 References: 1: Linux wildcards | How do wildcards work in Linux with examples? - EDUCBA 2: Wildcards in Linux explained with 10 examples | FOSS Linux 3: What are wildcard characters in Linux? – Sage-Answers
Which of the following statements regarding Linux hardware drivers is correct?
Drivers are regular Linux programs which have to be run by the user who wants to use a device.
Drivers are not used by Linux because the BIOS handles all access to hardware on behalf of Linux.
Drivers are stored on their devices and are copied by the Linux kernel when a new device is attached
Drivers are downloaded from the vendor's driver repository when a new device is attached.
Drivers are either compiled into the Linux kernel or are loaded as kernel modules.
Linux hardware drivers are software components that enable the Linux kernel to communicate with various devices, such as keyboards, mice, printers, scanners, network cards, etc. Drivers are either compiled into the Linux kernel or are loaded as kernel modules. Kernel modules are pieces of code that can be loaded and unloaded into the kernelon demand. They extend the functionality of the kernel without requiring to rebuild or reboot the system. Drivers that are compiled into the kernel are always available, but they increase the size and complexity of the kernel. Drivers that are loaded as kernel modules are only available when needed, but they require a matching version of the kernel and the module. Linux supports a large number of hardware devices, thanks to the efforts of the open source community and some vendors who provide drivers for their products. However, some devices may not have a driver available for Linux, or may require a proprietary driver that is not included in the Linux distribution. In such cases, the user may need to install the driver manually from the vendor’s website or from a third-party repository. References:
What command displays manual pages? (Specify ONLY the command without any path or parameters.)
man
The command that displays manual pages for Linux commands is the man command. The man command is used to display the manual pages for a given command or topic. For example, to view the manual page for the ls command, you can type:
man ls
This will open the manual page for the ls command in a pager, which allows you to scroll and search through the text. You can also specify the section number of the manual page if there are multiple pages with the same name. For example, to view the manual page for the passwd command in section 1, you can type:
man 1 passwd
The man command is one of the most useful and important commands for learning and using Linux. It provides detailed information about the syntax, options, arguments, examples, and other aspects of a command or topic. You can also use the --help option to get a brief summary of the usage and options of a command. For example, to get a quick help for the man command, you can type:
man --help
To learn more about the man command and how to use it effectively, you can refer to the following resources:
When typing a long command line at the shell, whatsingle charactercan be used to split a command across multiple lines?
\
The backslash character () is used to escape the meaning of the next character in a command line. This means that the next character is treated as a literal character, not as a special character. For example, if you want to use a space in a file name, you can use a backslash before the space to prevent the shell from interpreting it as a separator. Similarly, if you want to split a long command line across multiple lines, you can use a backslash at the end of each line to tell the shell that the command is not finished yet. The shell will ignore the newline character and continue reading the next line as part of the same command. For example, you can write:
ls -l/home/user/Documents
instead of:
ls -l /home/user/Documents
Both commands will produce the same output, but the first one is easier to read and type. References:
The ownership of the file doku.odt should be changed. The new owner is named tux. Which command accomplishes this change?
chmod u=tux doku.odt
newuser doku.odt tux
chown tux doku.odt
transfer tux: doku.odt
passwd doku.odt:tux
The correct command to change the ownership of the file doku.odt to a new owner named tux is chown tux doku.odt. This command uses the chown command, which stands for change owner, followed by the name of the new owner and the name of the file as arguments. The chown command allows you to change the user and/or group ownership of a given file, directory, or symbolic link12. The other options are incorrect because they use different commands or syntax that do not change the ownership of the file. For example:
References: 1: Chown Command in Linux (File Ownership) | Linuxize 2: chown command in Linux with Examples - GeeksforGeeks 3: Chmod Command in Linux (File Permissions) | Linuxize 4: newusers(8) - Linux man page 5: passwd(1) - Linux man page
What is the preferred source for the installation of new applications in a Linux based operating system?
The vendor's version management system
A CD-ROM disk
The distribution's package repository
The vendor's website
A retail store
The distribution’s package repository is the preferred source for the installation of new applications in a Linux based operating system. A package repository is a collection of software packages that are maintained by the distribution and can be easily installed, updated, or removed using a package manager. Package repositories offer several advantages, such as:
The other sources are not preferred because they may not offer these benefits and may cause problems with the system. The vendor’s version management system, the vendor’s website, or a CD-ROM disk may contain packages that are not compatible with the distribution or may conflict with other packages. A retail store may not have the latest or the most suitable packages for the system. References:
Which of the following are typical services offered by public cloud providers? (Choose three correct answers.)
Platform as a Service(PaaS)
Infrastructure as a Service(IaaS)
Internet as a Service(IaaS)
Graphics as a Service (GaaS)
Software as a Service (SaaS)
These are the three most common service models offered by public cloud providers12. They differ in the level of abstraction and control they provide to the customers.
References:
Which of the following tasks can the command passwd accomplish? (Choose two.)
Change a user's username.
Change a user's password.
Create a new user account.
Create a new user group.
Lock a user account.
The passwd command in Linux is used to change the password of a user account. A normal user can run passwd to change their own password, and a system administrator (the superuser) can use passwd to change another user’s password, or define how that account’s password can beused or changed1. The passwd command can also be used to lock or unlock a user account. Locking a user account means disabling the user’s ability to log in to the system, while unlocking a user account means restoring the user’s ability to log in. To lock a user account, the passwd command can be used with the -l option, followed by the username. To unlock a user account, the passwd command can be used with the -u option, followed by the username12. The passwd command cannot be used to change a user’s username, create a new user account, or create a new user group. These tasks require different commands, such as usermod, useradd, orgroupadd345. References: 1: Linux Passwd Command Help and Examples 2: Passwd command in Linux: 8 Practical Examples 3: usermod(8) - Linux man page 4: useradd(8) - Linux man page 5: groupadd(8) - Linux man page
Which of the following Linux Distributions is derived from Red Hat Enterprise Linux?
Raspbian
openSUSE
Debian
Ubuntu
CentOS
CentOS is a Linux distribution that is derived from Red Hat Enterprise Linux (RHEL). CentOS stands for Community Enterprise Operating System and it aims to provide a free, enterprise-class, community-supported computing platform that is functionally compatible with RHEL. CentOS is one of the most popular Linux distributions for servers and cloud computing. Raspbian, openSUSE, Debian and Ubuntu are other Linux distributions that are not derived from RHEL, but have their own origins and development histories. Raspbian is based on Debian and optimized for the Raspberry Pi. openSUSE is a community project sponsored by SUSE Linux and other companies. Debian is one of the oldest and most influential Linux distributions, and Ubuntu is derived from Debian and sponsored by Canonical Ltd. References:
Which of the following outputs could stem from the commandlast?
1 ls
2 cat text.txt
3 logout
Password for user last changed at Sat Mar 31 16:38:57 EST 2018
Last login: Fri Mar 23 10:56:39 2018 from server.example.com
EXT4-fs (dm-7): mounted filesystem with ordered data mode. Opts: (null)
root tty2 Wed May 17 21:11 - 21:11 (00:00)
The last command in Linux is used to display the list of all the users logged in and out since the file /var/log/wtmp was created1. The output of the last command shows the username, the terminal, the IP address, the login time and date, and the duration of the session for each record2. The option E is the only one that matches this format. Theother options are not related to the last command. Option A shows a list of commands executed by a user. Option B shows the password change information for a user. Option C shows the last login information for a user. Option D shows the mount information for a filesystem. References:
Which command copies the contents of the directory /etc/, including all sub-directories, to /root/?
copy /etc /root
cp -r /etc/* /root
cp -v /etc/* /root
rcp /etc/* /root
cp -R /etc/*.* /root
The correct command to copy the contents of the directory /etc/, including all sub-directories, to /root/ is cp -r /etc/* /root. This command uses the cp command, which stands for copy, and is used to copy files and directories on Linux and Unix systems. The command also uses the following options and arguments123:
The other options are incorrect because they use different commands or syntax that do not copy the contents of the directory /etc/, including all sub-directories, to /root/. For example:
References: 1: Cp Command in Linux (Copy Files) | Linuxize 2: cp command in Linux with examples - GeeksforGeeks 3: How to Copy Files and Directories in the Linux Terminal
What are the differences between a private web browser window and a regular web browser window? (Choose three.)
Private web browser windows do not allow printing or storing websites.
Private web browser windows do not store cookies persistently.
Private web browser windows do not support logins into websites.
Private web browser windows do not keep records in the browser history.
Private web browser windows do not send regular stored cookies.
A private web browser window is a mode of browsing that prevents the browser from saving your browsing history, cookies, and other site data, or information entered in forms. However, it does not prevent websites, your employer or school, or your internet service provider from tracking your online activity. The main differences between a private web browser window and a regular web browser window are:
References: Browse in private - Computer - Google Chrome Help, Browse InPrivate in Microsoft Edge - Microsoft Support, Private Browsing: What Is It and How to Use It | Edge Learning Center
What can be found in the /proc/ directory?
One directory per installed program.
One device file per hardware device.
One file per existing user account.
One directory per running process.
One log file per running service.
The /proc/ directory is a virtual file system that contains information about the system and the processes running on it. It is not a conventional file system that stores files on a disk, but rather a dynamic view of the kernel’s data structures. One of the features of the /proc/ directory is that it contains one subdirectory for each process running on the system, which is named after the process ID (PID). For example, the subdirectory /proc/1/ contains information about the process with PID 1, which is usually the init process. The process subdirectories contain various files that provide information about the process, such as its status, memory usage, open files, environment variables, command line arguments, and more. The /proc/ directory also contains a symbolic link called ‘self’, whichpoints to the process that is accessing the /proc/ file system. Therefore, the correct answer is D. One directory per running process.
The other options are incorrect because:
References:
Running the commandrm Downloadsleads to the following error:
rm: cannot remove ‘Downloads/’: Is a directory
Which of the following commands can be used instead to removeDownloads, assumingDownloadsis
empty? (Choose two correct answers.)
undir Downloads
rmdir Downloads
dir –r Downloads
rem Downloads
rm –r Downloads
To remove a directory, you need to use a command that can delete directories, not just files. The rm command can only remove files by default, unless you use the -r option, which stands for recursive. This option tells rm to delete the directory and all of its contents, including subdirectories and files. The rmdir command can also remove directories, but only if they are empty. If the directory contains any files or subdirectories, rmdir will fail and display an error message. Therefore, the correct commands to remove Downloads, assuming it is empty, are rmdir Downloads and rm -r Downloads. The other commands are either invalid or do not work on directories. References:
What happens to a file residing outside the home directory when the file owner's account is deleted? (Choose two.)
During a file system check, the file is moved to /lost +found.
The file is removed from the file system.
The UID of the former owner is shown when listing the file's details.
The user root is set as the new owner of the file.
Ownership and permissions of the file remain unchanged.
When a user account is deleted, the files owned by that user are not automatically deleted from the file system, unless they are in the user’s home directory. The files residing outside the home directory will remain unchanged, but they will have an invalid owner. The owner of a file is identified by a numeric user ID (UID), which is mapped to a user name by the /etc/passwd file. When a user is deleted, the corresponding entry in the /etc/passwd file is removed, but the UID of the file is not changed. Therefore, when listing the file’s details, the UID of the former owner is shown instead of the user name. For example, if the user alice with UID 1001 is deleted, and she owns a file named report.txt in the /tmp directory, the output of ls -l /tmp/report.txt will look something like this:
-rw-r–r-- 1 1001 users 1024 Nov 20 14:11 /tmp/report.txt
The user root is not set as the new owner of the file, nor is the file moved to /lost+found or removed from the file system. The /lost+found directory is used to store files that are recovered from a corrupted file system after running the fsck command, not from deleted user accounts. The file system check does not affect the ownership or permissions of the files, unless there is a serious inconsistency that needs to be fixed. References:
What is true about the su command?
It is the default shell of the root account.
It can only be used by the user root.
It runs a shell or command as another user.
It changes the name of the main administrator account.
It locks the root account in specific time frames.
The su command stands for substitute user or switch user. It allows you to run a shell or a command as another user, usually the superuser or root. To use the su command, you need to know the password of the target user. For example, if you want to switch to the root user, you can type su - and enter the root password. This will give you a root shell, where you can execute commands with administrative privileges. To exit the root shell, you can type exit or press Ctrl-D. The su command is not the default shell of the root account, nor can it only be used by the root user. It can be used by any user who knows the password of another user. The su command does not change the name of the main administrator account, which is always root on Linux systems. The su command also does not lock the root account in specific time frames, although there are other ways to do that, such as using the pam_time module. References:
TESTED 04 Dec 2024