LPI LINUX ESSENTIALS PRACTICE 2

What is the main difference between Linux and Windows/MAC OS?
Click the card to flip 👆
1 / 40
Terms in this set (40)
Linux is the open source software while the other two are closed source operating systems

Explanation
OBJ-1.1: Unlike either Windows or macOS, Linux is an open-source operating system, originally developed by Linus Torvalds back in 1991. Because it's open-source, it can be modified and extended by anyone.
Raspberry Pi

Explanation
OBJ-1.1: The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing and learn how to program in languages like Scratch and Python. The operating system Raspbian is a Debian-based Linux that was created to run on this device.
Writer

OBJ-1.2: Writer is a well-known word processor that is part of the LibreOffice suite. It can be used to replace just about anything that Microsoft Word can do. While vi and nano are text editors, they are not full-featured word processors like Microsoft Word. Pages is a word processor developed by Apple, and it only works on Mac OS X system
ownCloud

OBJ-1.2: ownCloud is a suite of client-server software for creating and using file hosting services. ownCloud functionally has similarities to the widely used Dropbox. The primary functional difference between ownCloud and Dropbox is that ownCloud does not offer data center capacity to host stored files. The Server Edition of ownCloud is free and open-source, thereby allowing anyone to install and operate it without charge on their own private server.
The "cd" command is short forChange directory Explanation OBJ-2.3: The cd command stands for Change Directory.Which option of the command history can be used to clear the user's history?-c Explanation OBJ-2.1: Using history -c will clear the current users' history. Question 13: CorrectWhat is the ls command used for in Linux?Lists the files within a directory Explanation OBJ-2.3: The ls command stands for list. The list command is used to display a listing of all files within a directory.Which of the following is true about environment variable names by convention?Contains all uppercase letters Explanation OBJ-2.1: By convention, all environmental variable names should contain only uppercase letters.Which command shows if /usr/bin is in the current shell search path?echo $PATH Explanation OBJ-2.1: The command "echo $PATH" will display the current shell search path. Once entering "echo $PATH" in the terminal, look at the path to verify if /usr/bin is listed as part of the path.Which of the following commands will output all of the lines with the name Fred in upper or lower case but not the word red from the file data_file?grep'[Ff]red' data_file Explanation OBJ-2.1: The command "grep '[Ff]red' data_file will display all occurrences of Fred and fred from the data_file. The options with "fred" will only display the lowercase version, and so will the one with "[f]red".What keyword should be used to fill in the blank in the following segment of the given shell script? for i in *; _____ cat $i donedo Explanation OBJ-3.3: The for loop lets you iterate or 'do' over a series of 'words' within a string.Which of the following options is used with tar to create a new .tar archive file?-c Explanation OBJ-3.1: The -c option is used to create a new tar file archive.Which option can be used with tail to print the last X bytes of a file to the screen?-c Explanation OBJ-3.2: The -c option is used with tail to print only the last X bytes of data to the screen.Which command would a user type to compress and package several files into a single file?zip Explanation OBJ-3.1: Zip is used to compress the files to reduce file size and is also used as a file package utility in Linux. Each file is stored in single .zip {.zip-filename} file with the extension .zip.Which command is used to print the last 10 lines of a file to the display?tail Explanation OBJ-3.2: Tail is a command which prints the last few numbers of lines (10 lines by default) of a certain file, then terminates.What is the correct statement to be used for comparison in a Linux shell script?if[$x-gt$y] Explanation OBJ-3.3: The standard syntax for an if statement is "if [ condition ]." In this case, the comparison is testing if the variable X is greater than the variable Y.Which command is used to print the first 10 lines of a file to the display?head Explanation OBJ-3.2: Head command is the opposite of the tail command. The head command is used to print the first 10 lines of a file. The tail command is used to print the last 10 lines of a fileYou have been asked to create a script will present the user with a onboard menu in which they can select 4 different commands to run by entering 1, 2, 3, or 4. Which of the following statements should you use to create the simplest and most effective method of choosing the command to run based on the user's input?case Explanation OBJ-3.3: A case statement uses a variable, and each pattern shown before the right parenthesis is a possible value of that variable. If the user's entry is equal to the value before the parenthesis, the case is run. Using a series of nested if-then-else statements will work, but it is rather clumsy and confusing to understand. A case statement is a much more efficient choice.Why is the file data.txt empty after executing sort data.txt > data.txt?because the file gets truncated before sort is executed. Explanation OBJ-3.2: This is because the redirection is carried out first. This means that the > data.txt truncates the file so that sort finds nothing.Which network device serves as the gateway between your internal network and external network?Router Explanation OBJ-4.4: A router is a device used to connect two networks, such as your internal and external networks. A router also usually serves as your default gateway in the networkWhat is the maximum amount of memory accessible by a 32-bit operating system?4GB Explanation OBJ-4.2: A 32-bit operating system can only access 4GB of memory. If you need to access larger amounts of memory, you need to install an x64 (64-bit) Linux OSWhich of the following software packages is a mail server?Postfix Explanation OBJ-4.1: Postfix is a free and open-source mail transfer agent that routes and delivers electronic mail. Thunderbird is a mail client, Apache is a web server, and GIMP is an image manipulation program.Which of the following is used as a virtual or pseudo filesystem used to interface with the kernel and system as a whole but not with individual processes?/sys Explanation OBJ-4.3: The /sys virtual filesystem is used to interact with the kernel and system as a whole. It did not provide any method to interact with individual processes and was created to move some of the original functions from /proc to /sys to clean up the /proc structureWhich of the following commands can be used to resolve a DNS name to an IP address?host Explanation OBJ-4.4: The host command is used for DNS (Domain Name System) lookup operations. It is used to find the IP address of a particular domain name or the domain name of a particular IP address. Nslookup and dig are also commands that can be used to lookup a domain name and convert it to an IP address within a Linux system.Which of the following is a requirement of the GPL license but not the BSD license?Users who modify and distribute the software under the GPL license make the modifications they made available to the recipients under the same license. Explanation OBJ-4.1: The GPL license is copyleft; therefore, users must disclose the source code and make any modified versions of the code open source. Under GPL, users cannot change any of the original license terms or introduce their own. The BSD license family does not compel users to do any of these things and instead has fairly relaxed redistribution terms.Which type of files is an important part of diagnosing problems with daemons?log files Explanation OBJ-4.3: Since daemons don't usually provide output to the screen, checking log files is an important part of diagnosing problems.Which of the following files contains a mapping of IP addresses to URLs locally on your Linux machine?/etc/hosts Explanation OBJ-4.4: The /etc/hosts file contains a mapping of IP addresses to URLs. Your browser uses entries in the /etc/hosts file to override the IP-address-to-URL mapping returned by a DNS server. This is useful for testing DNS (domain name system) changes and the SSL configuration before making a website live.Which file on a Linux system contains the passwords for each user on the system?/etc/shadow Explanation OBJ-5.1: The /etc/shadow file stores the actual password in an encrypted format (more like the hash of the password) for the user's account with additional properties related to the user password. Basically, it stores secure user account information. All fields are separated by a colon (:) symbol. It contains one entry per line for each user listed in /etc/passwd file.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 of the following commands is used to show the information about a directory or a symbolic link?ls-d Explanation OBJ-5.4: ls -d shows information about a directory or symbolic link. This information is usually just its respective path, though.Which file on a Linux system is modified to set the maximum number of days before a password must be changed?/etc/shadow Explanation OBJ-5.1: The /etc/shadow file stores the actual password in an encrypted format (more like the hash of the password) for the user's account with additional properties related to the user password. Basically, it stores secure user account information. All fields are separated by a colon (:) symbol. It contains one entry per line for each user listed in /etc/passwd file. The last 6 fields provide password aging and account lockout features.Which type of link is used to points to another file like a shortcut in Windows or a Macintosh alias?Symbolic link Explanation OBJ-5.4: A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file.What command is used to change the group ownership of a file?chgrp Explanation OBJ-5.2: The chgrp command is used to change the group ownership of a file.What is a special permission bit set on a file or a directory that lets only the owner of the file/directory or the root user delete or rename the file?Sticky bit Explanation OBJ-5.4: A sticky bit is a special permission bit set on a file or a directory that lets only the owner of the file/directory or the root user delete or rename the file. No other user is given privileges to delete the file created by some other user.