TEST 1 Flashcards

LPIC

1
Q

Which of the following does Raspbian Linux run on?

A

raspberry Pi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is an example of embedded Linux?

A

Android

a customized version of the Linux operating system (OS) that’s designed to run on embedded systems, such as mobile devices, routers, and other Internet of Things (IoT) devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

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 systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following is an American non-profit organization devoted to expanding the range of creative works available for others to build upon legally and to share?

A

Creative Commons
is an American non-profit organization devoted to expanding the range of creative works available for others to build upon legally and to share. The organization has released several copyright-licenses, known as Creative Commons licenses, free of charge to the public. These licenses allow creators to communicate which rights they reserve and which rights they waive for recipients or other creators’ benefit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the generic name given to the action of protecting shell meta-characters from being treated specially by the shell?

A

Quoting
is the generic name given to the action of protecting shell meta-characters from being treated specially by the shell.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following can be used to represent a single number from 3 to 9?

A

The range [3-9] is used to represent a single number of either 3, 4, 5, 6, 7, 8, or 9 within a search function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following is a valid option for a typical command to get its built-in usage information?

A

–help
option is used with most commands to provide built-in information on the command’s usage. For more detailed information, info <command></command> or man <command></command> could be used instead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which option will cause the echo command NOT to output a trailing newline?

A

-n

this option of the echo command does not output a trailing newline.

-n Displays the output while omitting the newline after it.
-E The default option. Disables the interpretation of escape characters.
-e Enables the interpretation of escape characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which of the following commands will output a list of all of the file names under your home directory and all subdirectories with file names ending with .pdf?

A

find ~ -name ‘*.pdf’

To display all of the files with a .pdf extension at the end. This will display all files named *.pdf in the home directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a set of pages that explain every command available on the system?

A

man pages

are a set of pages that explain every command available on the system. This includes information on what they do, the specifics of how to execute them, and what command-line arguments or syntax they accept.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Your current present working directory is /home/jason/documents/. You just entered cd .. into the command line and then enter pwd. What output do you receive?

A

The .. is a special directory reference to the parent of the current present working directory. Using cd .. essentially moves the pwd up a single level to /home/jason.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following options must be used to remove a directory and its subdirectories?

A

The rm -r option is used to remove a directory and its files/folders recursively.

-f: Forces the removal of all files or directories.
-i: Prompts for confirmation before removing.
-I: Prompts once before removing more than three files or when removing recursively.
-r: Removes directories and their content recursively.
-d: Removes empty directories.
-v: Provides a verbose output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are valid rules in naming a variable?

A

The name of a variable should only contain letters (a to z or A to Z), numbers ( 0 to 9), or the underscore character ( _). Variables should also always start with a letter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Consider the following script:

#!/bin/bash
 ip=`route -n | grep UG | tr -s “ “ | cut -f 2 -d “ “`
 echo “Checking to see if $ip is up...”
 ping -c 5 $ip 

Which of the following would be the first line displayed to the screen when the script is executed by the user?

A

The line in the script that starts with the echo command will cause the string, “Checking to see if $ip is up…” will be executed. When this is executed, the value of $ip will be replaced with the result of the command in the second line (which contains route).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the proper command to use to compress the file filename.txt into the zip archive called myfile.zip?

A

zip myfile.zip filename.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which option can be used with tail to print the last 10 lines of a file and then keep printing any new lines that may be added continuously?

A

-f

this option is used to “follow” the contents of the file. This lets tail print the last 10 lines of a file (usually a log file) and continue to print out new lines to the screen as they are added to the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What statement is used to get input from the terminal when a shell script is being run?

A

read

read command is used to get input from the terminal when using a shell script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which command is used to make a shell variable known to subsequently executed programs?

A

export

this command is used to make a shell variable known to subsequently executed programs. Essentially, the export command creates a globally accessible variable when it is run.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What option can be used with cat to display line numbers with the text of a file to the screen?

A

-n

this option will show the line numbers next to a file’s contents when displayed to the screen. For example, “cat -n song.txt” will display the contents of the song.txt file with line numbers down the left column of the display.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is one of the most basic features of a shell script?

A

Ability to run commands

A shell script is a computer program designed to be run by the shell. Typical operations performed by shell scripts include file manipulation and command execution. The most basic scripts run commands in serial order and do not provide any output back to the screen or seek input from a user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which of the following commands will create an archive file, named backup.tar, containing all the files from the directory /home?

A

tar -cf backup.tar /home

The tar command allows you to quickly access a collection of files and place them into a highly compressed archive file. The -c option creates a new archive while -f uses the given filename as the archive’s filename. Specifying the directory ensures the files to be placed in the archive file come from that folder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does HCL mean?

A

hardware compatibility list

HCL lists tested, compatible, and sometimes incompatible hardware devices for a particular distro.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which command is used to print the first 10 lines of a file to the display?

A

Head

this 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 file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a daemon?

A

A daemon is a computer program that runs as a background process rather than under the direct control of an interactive user. Daemons are commonly used for processes that maintain server operations, such as the HTTPD (HTTP daemon) used by Apache to provide web server services to an end-user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which of the following is the correct order of a computer’s operation?

A

(1) The computer waits for user input, (2) The user selects a command and enters it via the keyboard or mouse, (3) The computer executes the command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which of the following is a requirement of the GPL license but not the BSD license?

A

Users who modify and distribute the software under the GPL license must make the modifications they made available to the recipients under the same license

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

After installing a new package, in which directory are you most likely to find its configuration file?

A

/etc

The folder which contains all your system configuration files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Which of the following displays network connections for Transmission Control Protocol, routing tables, and a number of network interface and network protocol statistics?

A

netstat (SS is superior)

a command that displays network connections for Transmission Control Protocol, routing tables, and a number of network interface and network protocol statistics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Which of the following is used as a virtual or pseudo filesystem to provide a tree of all of the device nodes and drivers in the running kernel?

A

The /dev tree contains device nodes, which gives user space access to the device drivers in your OS’s running kernel. All POSIX type OSes have a /dev tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Which of the following directories is often used to store log files?

A

/var

a standard subdirectory of the root directory in Linux contains files to which the system writes data during the course of its operation. /var/log contains log files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Which of the following files holds the definition of the local user accounts?

A

/etc/passwd

contains the attributes of (i.e., basic information about) each user or account.

29
Q

Which type of link is used to points to another file like a shortcut in Windows or a Macintosh alias?

A

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.

30
Q

What permissions does foo1.txt have after running “chmod 644 foo1.txt”?

A

Permissions of 644 means that files are readable and writable by the file owner and readable by users in the group owner of that file and readable by everyone else.

31
Q

Which type of link contains the data in the target file?

A

A hard link, unlike a symbolic link, contains the data in the target file.

32
Q

Which of the following commands is used to show the information about a directory or a symbolic link?

A

ls -d

shows information about a directory or symbolic link. This information is usually just its respective path, though.

33
Q

A file currently has permissions of 755. Which of the following commands would change file permission to r-xr–r–?

A

To change permission, you use the chmod command. You can either use u+ to add user permission and g+ to add group permissions, or you can use the octal value. In this case, the octal value of r-wr–r– is 544. (or is it 454? pretty sure I’m right)

34
Q

Which of the following tasks is not performed automatically for a user account when it is created using the useradd command?

A

The useradd command does not create the user’s home directory by default.

To automatically create the user’s home directory with the useradd command, the -m option is used to create the user’s home directory with default configuration files.

35
Q

Which keyboard shortcut allows copying highlighted text while working in the command line terminal?

A

CTRL + SHIFT + C

Holding down the CTRL and SHIFT keys and pressing C allows any highlighted text in the terminal to be copied. Pressing CTRL + C within the terminal is recognized as a command interrupt.

35
Q

Which of the following programs on a Linux system could you use instead of Windows Media Player?

A

VLC

is a media player made by the VideoLAN project. It is cross-platform and works great on Linux systems to play all types of video and music files. The other options provided only work on Mac OS X or Windows systems.

36
Q

Which command line can be used to search help files that mention the word ‘copy’?

A

man -k copy

The –k option of the man command is equivalent to the apropos command. It searches the short manual page descriptions for keywords and displays any matches.

37
Q

Which of the following commands will create a single directory named dir1 dir2?

A

mkdir “dir1 dir2”

A space in the directory name can be used by enclosing the directory name within quotes (mkdir “dir1 dir2”). The above command will create a single directory named dir1 dir2 (with a space between dir1 and dir2).

38
Q

You have just created a text file with a secret password in it called password.txt. You want to ensure that the password is not seen when the ls command is run within the current directory. What command should you use to ensure the text file is hidden from the filesystem?

A

mv password.txt .password.txt

To hide a file in the Linux filesystem, simply rename it with a prefixed dot (.) to its filename. Therefore, mv password.txt .password.txt will cause the file password.txt to be renamed as a “dot” file and become hidden from the ls command.

39
Q

Your current present working directory is /home/jason/documents/. You just entered cd . into the command line and then enter pwd. What output do you receive?

A

/home/jason/documents/

The . is a special directory reference to the current present working directory. Using cd . essentially does nothing since you are asking the system to change from the pwd to the pwd. Therefore, you will get /home/jason/documents.

40
Q

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?

A

grep ‘[Ff]red’ data_file

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”.

41
Q

What must the user do to run a program that is not within a directory located in the PATH variable?

A

include the file path to the program

To run a program that is not within a directory located in the PATH variable, the user must include the file path to the program.

42
Q

What command would a user enter to delete a directory containing no other files or directories within it?

A

rmdir

this command removes each directory specified on the command line if they are empty. Each directory removed must contain no files or directories, or it cannot be removed by rmdir.

43
Q

When using a web browser, what should a user do to prevent private data from being stored locally?

A

Browsers can be configured to use a private mode that does not store any data locally

Private browsing (alternatively referred to as InPrivate Browsing, private window, or Incognito mode) is an Internet browser setting that prevents browsing history from being stored locally.

44
Q

Which of the following is NOT a heightened value proposition of Open Source Software compared to Proprietary Software?

A

Popularity

The heightened value proposition from open source compared to most proprietary formats include security, affordability, transparency, interoperability, scalability, and localization.

45
Q

What is the practice of offering people the right to freely distribute copies and modified versions of a work with the stipulation that the same rights be preserved in derivative works created later called?

A

Copyleft

Copyleft, distinguished from copyright, is the practice of offering people the right to freely distribute copies and modified versions of a work with the stipulation that the same rights be preserved in derivative works created later. Copyleft software licenses are considered protective or reciprocal, as contrasted with permissive free-software licenses.

46
Q

What is the main difference between Linux and Windows/MAC OS?

A

Linux is open source software while the other two are closed source operating systems

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.

47
Q

What is defined by a Free Software license?

A

The conditions for modifying and distributing the licensed software

A free software license is a notice that grants the recipient of a piece of software extensive rights to modify and redistribute that software.

48
Q

Which of the following commands can search for executable programs or scripts located in the PATH variable?

A

which

Using the command which, as in “which ls”, the PATH variable is searched and starting at the first directory found in the PATH, will look for the command ls. If it is not found, the next directory is searched, and so on.

49
Q

Which of the following directories contain all of the installed kernels on your system and their needed drivers?

A

/boot

The /boot directory contains the kernel, its associated files, and its needed drivers to boot up the operating system during the startup process.

50
Q

Which version of Linux should be installed on a system with a 64-bit processor?

A

x64

A 64-bit processor can support a 64-bit (x64) or 32-bit (x86) operating system. You should install a 64-bit operating system to ensure you can have more memory since 32-bit operating systems are limited to only 4 GB of memory.

51
Q

Which of the following information can be displayed by top?

A

Running processes, ordered by CPU or RAM consumption

The top command displays processor activity and also displays tasks managed by the kernel in real-time.

52
Q

Which of the following would properly identify the device associated with the second partition on the first hard disk on the first IDE controller of a system?

A

/dev/hda2

Partitions on these disks can range from 1 (for the first partition) to 16 (for the sixteenth partition). If you have a few ide/pata devices installed in a system, they will be hda (the first device), hdb (the second device), hdc (the third device), and so on. Each partition on that device will append a number to it, so the second partition on the first device would be /dev/hda2.

53
Q

What column tells the “w” program which session is running?

A

WHAT

The WHAT column tells the “w” program which session is currently running.

54
Q

Which UID is usually used to represent the first regular user on a Linux system?

A

1000

Regular users on a Linux system begin at UID 1000 and increment by 1 for each additional user.

55
Q

Which command would be used to change the owner of foo1.txt from jasondion to administrator?

A

chown

The command chown, an abbreviation of change owner, is used in Linux to change the owner of file system files and directories.

56
Q

Which file on a Linux system contains the passwords for each user on the system?

A

/etc/shadow

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.

57
Q

Which of the following is NOT contained in the /etc/passwd file?

A

The password of the user’s account

The password field is the second field in the /etc/passwd file. Due to the /etc/passwd file’s low security, the password is now stored in the /etc/shadow file instead, which can only be accessed by the root user. The /etc/passwd file now contains a single * in the password field to represent to the system that the real password is stored in /etc/shadow instead.

58
Q

Which command is used to change the password of a user’s account?

A

passwd

The passwd command is used to change the password of a user’s account. This command runs as the root user using SUID.

59
Q

Which option can be used with useradd to specify the home directory for a user?

A

-d

The -d option is used with useradd (useradd -d /path/to/directory username) to specify the user’s home directory location instead of using the default directory.

60
Q

Where should temporary files be stored on a Linux system that can be safely deleted during a reboot?

A

/tmp

/tmp is designed to be used as fast (and small) temporary storage with a short lifetime. Many Linux systems will delete the/tmp directory contents on each reboot, and many distributions will mount the directory in the RAM-disk. /var/tmp is instead normally located on a physical disk, is larger in size, and can hold temporary files for a longer time. /var/tmp is not usually automatically deleted when the system is rebooted since it is stored on the physical hard disk.

61
Q

Which version of Linux should be installed on a system with a 32-bit processor?

A

x86

62
Q

Which of the following is used as a virtual or pseudo filesystem used to interface with the kernel and process?

A

/proc

The /proc tree originated in System V Unix, where it only gave information about each running process, using a /proc/$PID/stuff scheme. Linux greatly extended that, adding all sorts of information about the running kernel’s status. The intended purpose for the /proc virtual filesystem is to provide an interface into the kernel and its processes.

63
Q

A Linux computer currently has no access to the internet. Which command is used to display and manipulate the information about the network gateway for the system?

A

route

Route command is used to show/manipulate the IP routing table. It is primarily used to set up static routes to specific hosts or networks via an interface.

64
Q

Which of the following commands would be used to display the value of the HOME variable to the terminal’s display?

A

echo $HOME

To display the contents of a variable to the terminal’s display, the command syntax is echo $VARIABLE, where VARIABLE is the variable’s name.

65
Q

Which redirection operator accepts text on the following lines as standard input?

A

«

The &laquo_space;redirection operator is used to accept text on the following lines as standard input.

66
Q

Which command is used to print the full contents of a file to the screen at once?

A

cat

The cat (short for “concatenate“) command is one of the most frequently used commands in Linux/Unix. The cat command allows the creation of single or multiple files, view file contents, concatenate files, and redirect output in the terminal to a file.

67
Q

Which command-line tool will create a filename that ends in .gz?

A

gzip

Gzip is a file compression tool that will create a file ending in the .gz extension to identify it as a compressed gzip archive.

68
Q

Which of the following options is used with tar to create a new .tar archive file?

A

-c

The -c option is used to create a new tar file archive.

69
Q

Which of the following is the file descriptor number used to represent the Standard Out (STDOUT)?

A

1

The standard out (STDOUT) is represented by the file descriptor number 1.

70
Q

The standard in (STDIN) is represented by what file descriptor number

A

0

The standard in (STDIN) is represented by the file descriptor number 0.

71
Q

Which option can be used with tail to print the last X bytes of a file to the screen?

A

-c

The -c option is used with tail to print only the last X bytes of data to the screen.

72
Q

Which of the following provides the correct syntax to search for lines beginning with the given pattern using the grep command?

A

^pattern

To search for lines beginning with the given pattern using grep, ^pattern should be used. If the pattern is enclosed in single quotes, it suppresses the meaning of all of the meta-characters with special meanings.