LPI Linux Essentials PRACTICE TEST 3

Ace your homework & exams now with Quizwiz!

Which of the following statements may be used to access the second command line argument to a script?

$2 Explanation OBJ-3.3: Inside a script, the $1 variable references the first argument from the command line and $2 is the second argument, and so on. The variable $0 references to the current script.

What symbol can be used to represent none, one, or multiple characters within search criteria?

* Explanation OBJ-2.4: The * is used to represent no, one, or multiple characters within search criteria. This process is known as globbing.

What is a set of standards that underlie most modern network communications at the software level?

TCP/IP Explanation OBJ-4.4: TCP/IP stands for Transmission Control Protocol/Internet Protocol, which is a set of networking protocols that allows two or more computers to communicate.

How is it possible to determine if an executable file is a shell script read by Bash?

The first line starts with #!/bin/bash Explanation OBJ-3.3: The first line of the script should start with #!/bin/bash. Most shell scripts will end with a .sh by convention, but it is not required. Remember, in Linux, file extensions are only useful to the end-user, but the operating system completely ignores them.

Which command line tool is used to compress a single file using the Burrows-Wheeler algorithm?

bzip2 Explanation OBJ-3.1: bzip2 is a free and open-source file compression program that uses the Burrows-Wheeler block sorting text compression algorithm and Huffman coding. It only compresses single files and is not a file archiver.

Which command can be used to display the contents of multiple files to the screen at once?

cat Explanation OBJ-3.2: The cat command can display the contents of multiple files to the screen at once. For example, "cat file1 file2" will display the contents of file1 and then file2 to the screen before ending the command.

How can the normal output of a command be written to a file while discarding the error output?

command >file 2>/dev/null Explanation OBJ-3.3: Specifying 2>/dev/null will filter out the errors so that they will not be output to your console. In more detail: 2 represents the error descriptor, which is where errors are written to. By default, they are printed out on the console. /dev/null is the standard Linux device where you send output that you want to be ignored.

What keyword should be used to fill in the blank in the following segment of the given shell script? for i in *; _____ cat $i done

do Explanation OBJ-3.3: The for loop lets you iterate or 'do' over a series of 'words' within a string.

Which of the following commands is used to view memory usage on a system?

free Explanation OBJ-4.3: The free command can be used to display the total amount of free space available, the amount of memory used and swap memory in the system, and the buffers used by the kernel. The top command can also be used to display the memory statistics, processor activity, and tasks managed by the kernel in real-time.

Which of the following options is used to gzip a file called filename?

gzip filename Explanation OBJ-3.1: The syntax for using gzip is "gzip filename". By default, when you compress a file or folder using the gzip command, it will have the same file name as before but with the extension .gz.

Which command is used to rename a file on Linux?

mv Explanation OBJ-2.4: The mv command is used to move a file or rename a file in Linux.

What does the "rm -rf" command do in Linux?

remove all the files in the directory and sub directories Explanation OBJ-2.4: The rm command is a UNIX and Linux command line utility for removing files or directories on a Linux system. When you combine the -r and -f flags, it means that recursively and forcibly remove a directory (and its contents) without prompting for confirmation. You should always keep in mind that "rm -rf" is one of the most dangerous commands, that you should be extremely careful when running on a Linux system, especially as root.

What umask should be set for a directory to have 700 as its octal permissions?

rwx------ Explanation OBJ-5.3: In Linux, you can convert letter permissions to octals by giving 4 for each R, 2 for each W, and 1 for each X. So, RWX is 7 and --- is 0.

Which command would a user type to create a new file within the current directory?

touch xplanation OBJ-2.4: The touch command is a standard command used in Linux to create a new file. If the file or directory already exists specified by the user in the touch command, then the timestamp of it will be changed or modified.

Which of the following commands increases the number of files within a directory?

touch newfile Explanation OBJ-2.4: The command touch is used to create a new file in the current directory. The command touch newfile will create a new empty textfile in the current directory. The ls and rmdir commands will not create a newfile in the directory. The command create here is not a valid command.

Which of the following is the UNIX device name for a physical or virtual terminal connection?

tty Explanation OBJ-1.4: A tty is the Unix device name for a physical or virtual terminal connection. It essentially represents a singular text/computer interface. On Linux, there are multiple tty interfaces (tty0, tty1, tty2, etc.). tty7 is the graphical interface.

Which of the following commands can be used to change default permissions for files and directories at the time of creation?

umask Explanation OBJ-5.3: The umask command is used to change the default permission for files and directories at the time of the file's creation.

What command can be used to find man pages that exist for a given command?

whatis Explanation OBJ-2.2: The whatis command can be used to find man pages that exist for a given command. Its output can also contain which sections are available.

Which option can be used with useradd to create a new user without a home directory?

-M Explanation OBJ-5.2: The -M option creates a user without a home directory using useradd. When the -m option is used, the user's home directory will be created using the system's default setup and template.

Which string should you add to put the date into the prompt of the shell?

/d Explanation OBJ-3.3: The \d option would be added to add the date to the prompt in the shell.

Which GID is usually used to represent the root group on a Linux system?

0 Explanation OBJ-5.1: The GID of 0 has a special role: it is always the root group.

Which storage device would be listed as /dev/sdb in Linux?

2nd hard drive Explanation OBJ-4.2: Storage devices are labeled as /dev/sd* with the * being a letter for the drive number. A is the first drive, B is the second, C is the third, and so forth.

Which of the following programs on a Linux system could you use as a replacement for Microsoft PowerPoint

Impress Explanation OBJ-1.2: Impress is the LibreOffice equivalent of Microsoft PowerPoint. It can even read and write to PowerPoint files directly from within Impress.

Which of the following answers is true for cloud computing?

Cloud provides new tools for IT resources. Explanation OBJ-1.4: Cloud computing empowers organizations to process larger workloads and offers enhanced collaboration and improved mobility for employees. This also allows for better management of IT resources and provides many new tools that can be used to manage IT resources.

Which Linux distribution is used as a basis for the creation of Ubuntu Linux?

Debian Explanation OBJ-1.1: Ubuntu is a free and open-source Linux distribution based on Debian.

Which of the following ways would NOT allow a user to perform a command-line task that requires root privileges?

Disabling firewalls and force open a directory, file, or folder. Explanation OBJ-5.1: A command-line task that requires root privileges can be done (1) by logging in directly as root at a shell or by using a remote login tool such as SSH, (2) by using the sudo command, or (3) by using the su command to switch to the root user.

Which of the following programs on a Linux system could you use as a replacement for Adobe Photoshop?

GIMP Explanation OBJ-1.2: Gimp is the open-source created competitor to Adobe Photoshop. It is a full-featured program, like Photoshop, but is completely free to use. It can read and write to Photoshop formatted files, too!

Which of the following is NOT TRUE about the Linux Distribution Life cycle?

Linux distros are always short term releases Explanation OBJ-4.1: Many distros offer short-term support versions and long-term support (LTS) versions. Therefore Linux distributions are not always short term releases. Most release schedules are publicly announced months or years in advance. Often, distributions are given catchy names for each of their versions. For example, Ubuntu had the Disco Dingo as one of their release versions. The final release version of a distribution is considered the most stable.

What is NOT one of the ways that DHCP can be used to deliver IP addresses?

Permanent Explanation OBJ-4.4: DHCP supports three mechanisms for IP address allocation. Automatic allocation allows DHCP to assigns a permanent IP address to a device. Dynamic allocation is used when DHCP assigns an IP address to a device for a limited period of time. Manual allocation occurs when a device's IP address is assigned by the network administrator, and DHCP is used to convey the assigned address to the device.

What does the letter t at the end of drwxrwxrwt indicate within the following directory permissions? drwxrwxrwt 14 root root 36864 2012-03-02 11:17 /tmp

The t is used to show that the directory is globally writable, but only the owner can delete their own files within the directory. Explanation OBJ-5.3: The t is a sticky bit, a specialized permission bit set on a directory that allows only the owner of the file within that directory, the owner of the directory, or the root user to delete or rename the file.

Which of the following is the filesystem for a CD-ROM?

isofs Explanation OBJ-4.3: The ISO File System (isofs) is a file system for optical disc media. Being published by the International Organization for Standardization (ISO), the file system is considered an international technical standard. Since the specification is available for anybody to purchase, implementations have been written for many operating systems, including Linux.

Which network interface always exists in a Linux system?

lo Explanation OBJ-4.4: lo is the loopback interface. This is a special network interface that the system uses to communicate with itself, and it exists even if there is no hardware network interface (like eth0 or wlan0) in the system.


Related study sets

Chapter 13: The Molecular Basis of Inheritance

View Set

BL Linux - Ch. 19 Networking Fundamentals

View Set

Chp 24 Making the Transition from Student to Professional Nurse

View Set

ATI Exam 1 (Renal, Oncology, Neuro)

View Set