---
# System prepended metadata

title: Teste Prático da Garça

---

# Teste Prático da Garça
![](https://i.imgur.com/2RTWbwF.jpg)
## Linux Essentials

### Chapter 02 Exam

#### 1. When choosing a distribution of Linux, you should consider: 
* If the application software is supported by the distribution 
* Will commercial support be required for the OS
* Does your organization require long-term support for the system
* Does the distribution offer a "stable" version

#### 2. Embedded Systems means:
* Systems designed to do a specific task on hardware optimized for only that purpose

#### 3. In Linux, RPM can be defined as:
* The Package Manager program for Red Hat Linux

#### 4. Linux originally only ran on:
* Intel 386 PCs

#### 5. Artificial intelligence has little potential for gains in efficiency, safety and productivity.
* False

#### 6. Linux Mint is:
* A fork of Ubuntu Linux

#### 7. A computer running Linux can:
* All of the above

#### 8. Bundling utilities, management tools, and application software with a Linux kernel is called a:
* A distribution of Linux

#### 9. Which distributions are made by, or are clones of, RedHat?(choose two)
* Fedora
* CentOS

#### 10. When choosing a distribution of Linux, you should consider: (choose five)
* If the application software is supported by the distribution
* Will commercial support be required for the OS  
* Does your organization require long-term support for the system
* Does the distribution offer a “stable” version
* Will users require a GUI 


### Chapter 03 Exam

#### 11. Which of the following are examples of desktop software? (choose two)
* Web browser
* Music player


#### 12. Which of the following pieces of software deal with file sharing? (choose three)

* Samba
* Netatalk
* NFS

#### 13. Which of the following are examples of text editors? (choose four)

* vim
* emacs
* pico
* nano

#### 14. An interpreted programming language:(choose two)

* Is converted into machine specific instructions as the program runs
*  Tends to offer more features than compiled languages

#### 15.  Which package manager is used in Fedora, a Red Hat derived system?

* yum


#### 16. In virtualization, what are the host and guest?

* Aguest is a virtual machine
* The host is the machine that runs the virtual machines


#### 17. Which of the following are traits of cloud computing?

* Resources can be accessed from anywhere over a network
* Scales IT resources so you pay for what you use

#### 18. To protect your privacy online, you can configure your computer to check for updates periodically.

* True

#### 19. Which of the following are traits of a multiuser operating system? (choose three)

* Many users can log in simultaneously with a unique account
* Users can protect their information from other users
* Resources are shared between users

#### 20. Two components that provide the ability to implement a firewall include: (choose two)

* iptables
* gufw


### Chapter 04 Exam

#### 21. Linux source code is available to:
* Anyone who has the knowledge needed to access it 

#### 22. A license where you don’t have access to the source code is called:
* Closed source

#### 23. Open source licenses differ, but generally agree that:
* You should have access to the source code of software
* You should be able modify the software as you wish 

#### 24. Richard Stallman is associated with:
* The Free Software Foundation

#### 25. The Free Software Foundation believes that:
* Software should be free to share
* Software should be free to modify

#### 26. Which of the following licenses was made by the FSF? 
* GPLv3

#### 27. Who founded the Open Source Initiative?(choose two)
* Bruce Perens
* Eric Raymond

#### 28. Which are examples of permissive software licenses?(choose two)
* BSD
* MIT

#### 29. If a podcast is licensed under the CC BY-ND license, you may:(choose two)
* Share it as long as you give credit to the author
* Post it to your website


#### 30. How can you make money from open source software?(choose three)
* Provide paid consulting services for users
* Take payments for fixing bugs
* Sell hardware that’s built to work with the software 

### Chapter 05 Exam

#### 31. Which environment variable contains a list of directories that is searched for commands to execute?
* PATH

#### 32. Select the command that can report the location of a command:
* which

#### 33. A pair of single quotes ( ' ) will prevent the shell from interpreting any metacharacter.
* True

#### 34. A pair of double quotes (" ) will prevent the shell from interpreting any metacharacter.
* False

#### 35. The semicolon (;) can be used to separate multiple commands to be executed in order.
* True

#### 36. The _______ command will print a list of the commands that you've previously executed.
* history

#### 37. To execute the same command as previously executed five commands ago, you would type: 
* !-5

#### 38. The shell program interprets the commands you type into the terminal into instructions that the Linux operating system can execute.
* True


#### 39. What one character treats the character that follows it as if it was surrounded by single quotes?
* \

#### 40. HOME is an example of _________.
* An environment variable


### Chapter 06 Exam

#### 41. What is the standard option to provide a command line program to view its documentation?
* --help

#### 42. The command man -k is the same as the command apropos.
* True

#### 43. The whatis command is the same as man -w.
* False

#### 44. The directory where additional documentation for software packages most likely can be found is: 
* /usr/share/doc

#### 45. Commands typically executed by a user are covered in what section of the manual?
* 1

#### 46. To search the man page sections for the keyword example, which of the following command lines could you execute?
* man -k example
* apropos example

#### 47. To get help on using the info command, execute (choose two)
* man info
* info info

#### 48. To get help while using the info command, press:
* Shift+H

#### 49. The _____ command is normally executed daily to update the database of all files that are on the system.
* updatedb

#### 50. The man command searches each of the sections in order until it finds a match.
* True


### Chapter 07 Exam


#### 51. Hidden files are files that begin with what character?
* A period(.)

#### 52. Is the following path absolute or relative? /etc/ppp
* Absolute

#### 53. Is the following path absolute or relative? sysadmin/Documents
* Relative


#### 54. Is the following path absolute or relative? ../../home/sysadmin
* Relative


#### 55. The tilde (~) is used to represent:
* A user's home directory

#### 56. Which of the following commands can be used to access the home directory of the user “bob” while logged in as root? (choose two)
* cd /home/bob
* cd ~bob


#### 57. The double dot (..) can be used with the cd command to represent:
* The directory above the current working directory


#### 58. The cd command by itself will take you to what directory?
* Your home directory

#### 59. What command will allow you to change your current working directory?
* cd

#### 60. The double dot (..) can be used to represent the directory…
* …above the current directory.

#### 61. The ls command without options or arguments…
* …lists the contents of the current directory.

#### 62. The first character in a long listing (ls -l) indicates:
* If something is a file, directory, or symbolic link

#### 63. Which option for the ls command, when used in conjunction with the -l option, will display human-readable file sizes?
* -h

#### 64. Which of the following commands will prevent any aliased options to the ls command?
* \ls

#### 65. The ls command color codes results by default. True or False?
* False

#### 66. The command ls -S will sort files:
* By size, largest to smallest




### chapter 08 Exam

#### 67. When using the cp command, you must provide both a source and a destination.
* True

#### 68. Which option(s) can be used to prevent cp from overwriting an existing file?(choose two)
* -i

#### 69. The command rm -r will...
* remove a directory along with any files or subdirectories.

#### 70. The rm command can delete multiple files at once.
* True

#### 71. Which of the following commands can be used to rename a file?
* mv

#### 72. The main purpose of using glob characters is to be able to provide a list of filenames to a command.
* True


#### 73. The asterisk character is used to represent zero or more of any character in a filename.
* True

#### 74. Which of these commands will return /etc/gai.conf /etc/pam.conf /etc/ucf.conf (choose two)
* echo /etc/???.*f

#### 75. Brackets cannot be used to a represent a range of characters.

* False

#### 76. Which command would list files that do not begin with a T or a W?

*  echo /etc/[!TW]*





### Chapter 09 Exam


#### 77. Lossy compression: (choose three)
* Usually results better compression than lossless 
* Is often used with images   
* Sacrifices some quality

#### 78. You type gzip myfile.tar. What happens? (choose two)
* myfile.tar is removed
* myfile.tar.gz holds a compressed version of myfile.tar

#### 79. Which flag would you pass to tar in order to have it make a new archive? 
* -c

#### 80. In the command tar -cvjf foo.tbz a b c, what are a, b, and c?
* File names to be added to the archive

#### 81. Given the command tar –cvjf homedirs.tbz /home, which of the following are true? (choose two)
* The command will print out each filename as it is processed
* The output file will be compressed 

#### 82. Which of the following commands will create a zipfile with the contents of your Documents directory?
* zip -r mydocs.zip Documents

#### 83. Given a file called documents.zip, how can you see what’s in it without extracting the files?
* unzip -l documents.zip

#### 84. You try to compress a file that is already compressed. Which of the following statements is true?
* The file will not be compressed any further than it already was 

#### 85. Which two programs use the Lempel-Ziv-Markov chain algorithm?(choose two)
* gzip
* xz

#### 86. By default, the zip command replaces uncompressed files with compressed files.
* True


### Midterm Exam (Modules 1-9)

#### 87. The most popular Linux platform for mobile phones is:
* Android

#### 88. The release cycle:
* Dictates how often software is updated


#### 89. What does a distribution provide to add and remove software from the system?
* Package Manager

#### 90. A maintenance cycle:
* Describes how long a version of software will be supported

#### 91. When choosing a distribution of Linux, you should consider: (choose five) 
* If the application software is supported by the distribution
* Will commercial support be required for the OS
* Does your organization require long-term support for the system
* Does the distribution offer a “stable” version
* Will users require a GUI

#### 92. Which of the following are examples of desktop software?(choose two) 
* Web browser
* Music player

#### 93. Which of the following pieces of software deal with file sharing? (choose three)
* Samba
* Netatalk
* NFS

#### 94. The Linux shell:(choose three)
* Allows you to launch programs
* Has a scripting language
* Is customizable

#### 95. Virtualization means:
* A single host can be split up into multiple guests

#### 96. In graphical mode, you can get to a shell by running which applications?(choose two)
* Terminal
* Xterm

#### 97. Source code refers to:
* A human-readable version of computer software

#### 98.  source means:(choose two) 
* You can view the software's source code
* You can modify the software's source code

#### 99. A copyleft provision in a software license means:
* If you redistribute the software, you must distribute the source to any changes you make

#### 100. Linux is distributed under which license?
* GPLv2 

#### 101. Creative Commons licenses allow you to: (choose three)
* Specify whether or not changes must be shared
* Specify whether or not people may distribute changes
* Allow or disallow commercial use

#### 102. Which environment variable contains a list of directories that is searched for commands to execute?
* PATH

#### 103. Select the command that can report the location of a command:
* which

#### 104. A pair of double quotes (" ) will prevent the shell from interpreting any metacharacter.
* False


#### 105. The shell program interprets the commands you type into the terminal into instructions that the Linux operating system can execute.
* True

#### 106. The acronym CLI stands for:
* Command Line Interface 

#### 107. The most common shell used for Linux distributions is the ________ shell.
* Bash

#### 108. Which two pager commands are used by the man command to control movement within the document?(choose two) 
* more
* less

#### 109. To search the man page sections for the keyword example, which of the following command lines could you execute? (choose two)
* man -k example
* apropos example

#### 110. The statement that describes the difference between a man page and an info page is: 
* The info page is like a guide; a man page is a more concise reference.

#### 111. The following sections commonly appear on a man page:(choose three)
* NAME
* DESCRIPTION 
* SYNOPSIS

#### 112. The top-level directory on a Linux system is represented as:
* /


#### 113. The tilde (~) is used to represent:
* A user's home directory 

#### 114. The cd command by itself will take you to what directory?
* Your home directory 

#### 115. What command will allow you to change your current working directory? 
* cd

#### 116. The first character in a long listing (ls -l) indicates:
* If something is a file, directory, or symbolic link

#### 117. Which of the following commands can be used to rename a file?
* mv

#### 118. The touch command can be used to: (choose two)
* Create new files 
* Update the timestamp of existing files


#### 119. Which of the following are glob characters? (choose three) 
* The asterisk *
* The question mark ?
* The square brackets [ and ]


#### 120. The main purpose of using glob characters is to be able to provide a list of filenames to a command.
* True

#### 121. The asterisk character is used to represent zero or more of any character in a filename.
* True

#### 122. Compression of a file works by:
* Removing redundant information 

#### 123. Lossy compression:(choose three)
* Usually results better compression than lossless
* Is often used with images
* Sacrifices some quality 

#### 124. Which of the following commands can be used to compress a file?(choose three)
* gzip
* zip
* bzip2

#### 125. The three main modes of tar are:(choose three)
* Create
* Extract
* List

#### 126. In the command tar -czf foo.tar.gz bar, what is the purpose of the f flag?
* Tells tar to write to the file that follows the flag


### Chapter 10 Exam

#### 127. A file begins with #!/bin/csh. This means:
* Running the script will invoke /bin/csh to interpret the rest of the file


#### 128. Which are appropriate editors for writing shell scripts? (choose two)
* vi
* nano


#### 129. Most of nano’s commands take the form of:
* Control and another character


#### 130. What does this shell script do?
:::success
    FOO=/tmp/foo
    if [ ! –d $FOO ]; then
        mkdir $FOO
    fi
:::
* Creates /tmp/foo if it does not exist


#### 131. Which of the following are correct about for and while loops? (choose two)
* for loops operate over a fixed list of items
* while loops have a test each cycle to determine if it should run again


#### 132. Given the following part of a script: What is the meaning of $1?
:::success
    if [ -f $1 ]; then
        echo “I am here”
    fi
:::
* It is the first argument passed to the script


#### 133. Given the following script that is run through ./test.sh hello goodbye: When will “I am here” be printed?
:::success
    if [ -f $2 ]; then
        echo "I am here"
    fi
:::
* If a file called “goodbye” exists in the current directory


#### 134. What is the correct way to assign the word “Hello” to a variable?
* A=”Hello”


#### 135. What is the correct way to save the current directory to a variable?
* A=`pwd`

#### 136. Which shell command accepts input from the user’s keyboard?
* read 

#### 137. What information is held inside $? ?
* The previous command’s exit code


#### 138. How would you finish your script with an exit code of 42?
* exit 42

#### 139. The if command looks for what exit code to consider a condition to be true?
* 0

#### 140. The number of users logged in is in a variable called USERS. How would you test to see if 5 users are logged in?
* test $USERS –eq 5

#### 141. Given the following script: Which of the following are true? (choose two)
:::success
    while [ ! –f /tmp/foo ]; do
        echo –n “.”
        process_data > /tmp/foo
    done
:::

* If a file called /tmp/foo exists, process_data won’t be run
* process_data will be called at most once


#### 142. A conditional that lets you make multiple comparisons with a pattern is called:
* case

#### 143. What is the meaning of $(( $i + 1)) ?
* 1 will be added to the i variable


#### 144. How would you write a test that says “if /tmp/foo is a directory or USERS is greater than 5”?
* test –d /tmp/foo –o $USERS –gt 5



### Chapter 11 Exam

#### 145. Which are appropriate editors for writing shell scripts?(choose two)
* nano
* vi

#### 146. What does this shell script do?
:::success
    FOO=/tmp/foo
if [ ! –d $FOO ]; then
    mkdir $FOO
fi
:::

* Creates /tmp/foo if it does not exist

#### 147. Given the following part of a script:

:::success
if [ -f $1 ]; then
    echo “I am here”
    
fi
:::

#### 148. What is the meaning of $1?

* It is the first argument passed to the script

#### 149. Given the following script that is run through ./test.sh hello goodbye:

:::success

if [ -f $2 ]; then
    echo "I am here"
    
fi
:::

#### 150. When will “I am here” be printed?

*  If a file called "goodbye" exists in the current directory
 
#### 151. What is the correct way to save the current directory to a variable?

*  A=`pwd`
 
#### 152. Which shell command accepts input from the user’s keyboard?

* read

#### 153. What information is held inside $? ?

* The previous command’s exit code

#### 154. Given the following script:

while [ ! –f /tmp/foo ]; do
    echo –n "."
    process_data > /tmp/foo
done

#### 155. Which of the following are true?

*  If a file called /tmp/foo exists, process_data won’t be run
*  process_data will be called at most once


#### 156. A conditional that lets you make multiple comparisons with a pattern is called:

* case

#### 157. How would you write a test that says "if /tmp/foo is a directory or USERS is greater than 5"?

* test –d /tmp/foo –o $USERS –gt 5


### Chapter Exam 12

#### 158. Which of the following are valid CPU types for Intel-based platforms? (choose two)

* 64-bit
* 32-bit


#### 159. 64 bit platforms can access more memory than 32 bit platforms. True or False?

* True


#### 160. Choose all of the following statements that are true in regard to virtual RAM: (choose three)

* Virtual RAM is stored on a hard drive
* Virtual RAM is used when available physical RAM is low.
* Virtual RAM is also called swap space


#### 161. Which of the following are common busing systems? (choose two)

* USB
* PCI


#### 162. A division of a hard drive may be referred to as a _______ .

* partition


#### 163. Which of the following are valid partitioning types? (choose two)

* GPT
* BIOS


#### 164. The fdisk command is a tool used for working with the MBR partitioned disks. True or False?

* True


#### 165. Which of the following is the valid device file name for the first IDE hard drive on the system?

* /dev/hda


#### 166. Which of the following are valid video cable connector types? (choose two)

* VGA
* DVI

#### 167. Which of the following commands will display CPU information? (choose two)

* lscpu
* arch

#### 168. What are the advantages of solid state disks when compared to traditional spinning platter hard disks? (choose two) 

* Faster system boot times
* Low power consumption


##### 169. Software that allows hardware devices to communicate with the installed operating system is called?

* Drivers

#### 170. Which of the following commands will check hard disk MBR partitions? (choose three)

* fdisk
* cfdisk
* sfdisk

#### 171. Which of the following commands will check hard disk GPT partitions? (choose three)

* gdisk
* sgdisk
* cgdisk


### Chapter 13

#### 172. When you execute the dmesg command, the system displays messages that are generated by the kernel. True or False?

* True

#### 173. The Linux kernel mounts the following pseudo-filesystems to provide access to information about hardware devices connected to the system: (choose two)

* /proc
* /sys

#### 174. The /proc directory contains a subdirectory for each process present on the system. True or False?

* True

#### 175. The Process ID (PID) of the init process is:

* 1

#### 176. The process (ps) command shows only processes running in the current shell by default. True or False?

* True

#### 177. The following system load averages are displayed by the top command: (choose three)

* 15 minute
* 1 minute
* 5 minute

#### 178. The free command outputs statistics about:

* Memory usage

#### 179. What directory typically contains log files?

* /var/log

#### 180. Which log file contains messages regarding authentication and authorization?

* secure

#### 181. All log files contain only text data. True or False?

* False

#### 182. A load average of 1.0 always means the system is fully loaded. True or False?

* False

#### 183. A command that will continuously update statistics about running processes:

* top

#### 184. Which of the following is a valid Linux option style for Traditional Unix:

* a single dash (-)

#### 185. Which file contains the information passed to the kernel at boot time?

* /proc/cmdline

#### 186. To make changes permanent for kernel parameter files found under /proc/sys, the following file can have entries added to it:

* /etc/sysctl.conf

#### 187. The /var directory has files that change over time. True or False?

* True

#### 188. Information about the init process can be found in the /proc/1 directory. True or False?

* True

#### 189. Which of the following commands will allow you to view all processes on the system? (choose two)

* ps -ef
* ps aux

#### 190. The logging daemon on recent Linux distributions based on systemd is called:

* journald

###### 191. What does the acronym FHS stand for among the the standards supported by the Linux Foundation?

* Filesystem Hierarchy Standard
#### 192. Which directory is the root of the filesystem?

* /

#### 193. The sbin directories are primarily intended to be used by the root user. True or False?

* True



### Chapter Exam 14

#### 194. Which of the following would be considered a host?
* A printer attached to the network via an IP address

#### 195. A service is...
* ...a feature provided by one computer to another.
 
#### 196. Only servers have hostnames.
* False

#### 197. Which of the following protocols defines how network communication functions?
*  TCP/IP

#### 198. Which of the following are valid IPv4 addresses?
* 192.105.10.10
* 10.33.55.77

#### 199. Which of the following commands will display the IP address on a Linux system?
* ifconfig

#### 200. Which of the following commands will display the routing table?(choose two)
* route
* netstat -r

#### 201. Which of the following commands will allow you to log into the machine server1 with the account name nick?
* ssh nick@server1

#### 202. When looking at the primary IPv4 configuration file, if the device was configured to be a DHCP client, then the BOOTPROTO value would be set to none.
* False

#### 203. When issuing the service network restart command, which of the following occurs?

* ...takes down all network interfaces, re-reads all related configuration files and then the networking for the system is restarted.


### Chapter Exam 15

#### 204. Which files contain user account information? (choose two)
#### 
* /etc/shadow
* /etc/passwd

#### 205. Which user can view the /etc/shadow file?
* The root user

#### 206. Which command will display the UID, GID and groups your current user belongs to?
* id

#### 207. Each user belongs to at least one group. True or False?
* True

#### 208. Which command will display the users that are currently logged in to the system?
* who

##### 209. The sudo command allows regular users to…
* …execute commands as another user.

#### 210. Which of the following commands will display the group(s) a user belongs to?
* id

#### 211. Which of the following commands will display the groups that the user bob belongs to?
* id bob

#### 212. The /etc/group file follows what structure?
* group_name:password_placehoder:GID:user_list

#### 213. A GID is associated with a group name. True or False?
* True

#### 214. A user can belong to…
* At least 16 groups

#### 215. Sudo privileges can be used to specify which user can use the sudo command to execute commands as other users. True or False?
* True

#### 216. In distributions that do not allow the root user to login directly or via the su command, the installation process automatically configures one user account to be able to use the sudo command to execute commands as if they were executed by the root user. True or False?
* True

#### 217. Which of the following commands will display how long the system has been running since the last boot? (choose two)
* uptime
* w

#### 218. The /etc/shadow file contains plain-text passwords. True or False?
* False

#### 219. Which command can be used to view the /etc/passwd file entries?
* getent

#### 220. All Linux systems allow administrators to log in as  root. True or False?
* False

#### 221. What is the default user for the su command?
* The root user

#### 222. Which command would allow a user to execute commands as root?
* sudo

#### 223. File permissions cannot be edited by the root user. True or False?
* False

#### 224. Which command is used to display only the user’s primary group?
* id -g

#### 225. Traditional UNIX systems allowed users to belong to how many groups?
* 16

#### 226. What would an account with the UID 376 typically be used for?
* System service access.

#### 227. Usernames cannot be the same as group names. True or False?
* False

#### 228. To display the group(s) a user belongs to use this command:
* id

#### 229. Which command will display the groups that the root user belongs to?
* id root

#### 230. A value of 0 in the “minimum” password aging field means the user cannot change their password. True or False?
* False

#### 231. The “Epoch” began on January 1, 1970. True or False?
* True

#### 232. The last command displays reboot records…
* By default

#### 233. Sudo privileges allow users to execute commands as another user. True or False?
* True

#### 234. When using the sudo command to execute a command as the root user, the command prompts for the user’s own password, not that of the root user. True or False?
* True

#### 235. The first line of this command displays how long the system has been running since being rebooted.
* w

#### 236. The /etc/shadow file contains encrypted passwords. True or False?
* True

#### 237. Which command can be used to view the /var/log/wtmp file entries?
* last







### Chapter 16 Exam

#### 238. On a system that does not use UPG, the useradd command will also create a user group. For example, user bob, group bob.
* False

#### 239. Which option for the usermod command can be used to specify a user's group ID (either primary or secondary)?(choose two)
* -g
*  -G

#### 240. The groupmod command can be used to change a group name.
* True

#### 241. The groupmod command can be used to change a group GID.
* True

#### 242. Which of the following commands can be used to modify a group?
* groupmod

#### 243. Which command can be used to determine a user's most recent log in?
* last

#### 244. If a user is deleted, the files and directories that the user owned...
*  ...may be important for others in the organization

#### 245. Which option for the usermod command can be used to specify a user's primary group ID?
* -g

#### 246. Which of the following commands can be used to modify a user?
* usermod

#### 247. Which command can be used to determine a user's most recent log in?
* last




### Chapter 17 Exam

#### 248. Which of the following are methods for setting permissions using the chmod command?(choose two)

* octal
* symbolic

#### 249. The user sysadmin will be able to change the permissions of a file because they own it
* True

#### 250. Octal notation uses the following values for the permissions granted:
*  r = 4, w = 2, x = 1

#### 251. A user cannot delete a file if they do not own it.
* False

#### 252. The execute permission on a file allows you to:
* Run the file as a script

#### 253. The chgrp command can be used on a file by:
* The file owner and root

#### The chown command can be used to change the user owner on a file by:
* Only root

#### Which of the following chown commands will change the myFile user ownership to the user sam and the group ownership to administrators?(choose two)
* chown sam:administrators myFile
* chown sam.administrators myFile

#### The chown command permits changing group ownership done by root only.
* False

#### The user owner of a file will always have the same or higher permissions as "other".
* False

### Chapter Exam 18

#### 254. The /tmp directory is a temporary directory designed as a location where any user can create a temporary file. True or False?
* True

#### 255. The “sticky bit” permission…
* …prevents others from removing files they don’t own from a common directory.

#### 256. Which of the following commands will set the “sticky bit” on /shared ?
* chmod 1777 /shared

#### 257. The “setuid” permission…
* …allows a command to be run as the file owner.

#### 258. Which of the following commands will set setuid for /usr/bin/program?
* chmod 4755 /usr/bin/program

#### 259. The “setgid” permission… (choose two)
* …allows a command to be run as the group owner of the file.
* …allows files created in a directory to be owned by the group that owns the directory.

#### 260. Which of the following commands will set setgid on /shared ?
* chmod 2777 /shared

#### 261. Which of the following long listings represents setgid set for /shared ?
* drwxrwsrwx. 12 root group 4096 Oct 21 13:12 /shared

#### 262. Setting setgid on a directory…
* …will set the group owner of all files created in the directory to the group owner of the directory.

#### 263. Deleting a source file will break an associated hard link. True or False?
* False

#### 264. A source and a hard link must be part of the same filesystem. True or False?
* True
#### 265. Deleting a source file will break an associated symbolic link. True or False?
* True

#### 266. A source file and a symbolic link must be part of the same file system. True or False?
* False

#### 267. Which of the following commands would create a hard link, link to file?
* In file link

#### 268. Which of the following commands would create a symbolic link, link to file?
* ln -s file link

#### 269. Which of the following ls commands, when executed, will only show information about the directory itself? (choose two)
* ld -d
* ls -ld

#### 270. Which of the following directories are designed as locations where any user can create a temporary file? (choose two)
* /tmp
* /var/tmp

### Chapters 9-18 Exam
#### 1. Which of the following are traits of a multiuser operating system?
* Resources are shared between users
* Users can protect their information from other users
* Many users can log in simultaneously with a unique account
#### 2. A pipe allows you to... 
* …send the output of one command to another.
#### 3. Channel 2 is:
* STDERR
#### 4. The grep command...
* …will display all the lines in a file containing the specified Regular Expression.
#### 5. Which of the following commands can be used to scroll through a text file?
* less
* more
#### 6. Which command can be used to print line numbers?
* nl
#### 7. Which are appropriate editors for writing shell scripts?
* vi
* nano
#### 8. Which of the following are correct about for and while loops?
* while loops have a test each cycle to determine if it should run again
* for loops operate over a fixed list of items
#### 9. What is the correct way to assign the word "Hello" to a variable? 
* A=”Hello”
#### 10. What is the correct way to save the current directory to a variable? 
* A=`pwd`
#### 11. What is the meaning of $(( $i + 1)) ?
* 1 will be added to the i variable
#### 12. Which of the following are valid CPU types for Intel-based platforms? (choose two)
* 64-bit
* 32-bit
#### 13. Choose all of the following statements that are true in regard to virtual RAM: (choose three)
* Virtual RAM is also called swap space
* Virtual RAM is stored on a hard drive
* Virtual RAM is used when available physical RAM is low.
#### 14. A division of a hard drive may be referred to as a _______ .
* partition
#### 15. The fdisk command is a tool used for working with the MBR partitioned disks. True or False?
* true
#### 16. Which of the following commands will display CPU information? (choose two)
* lscpu
* arch
#### 17. The Process ID (PID) of the init process is: 
* 1
#### 18. What directory typically contains log files? 
* /var/log
#### 19. The /var directory has files that change over time. True or False?
* true 
#### 20. Which of the following commands will allow you to view all processes on the system? (choose two)
* ps-ef
* ps aux
#### 21. Which directory is the root of the filesystem?
* /
#### 22. A service is…
* …a feature provided by one computer to another.
#### 23. Only servers have hostnames.True or False?
* false
#### 24. Which of the following are valid IPv4 addresses? (choose two)
* 10.33.55.77
* 192.105.10.10
#### 25. Which of the following commands will allow you to log into a remote machine?
* ssh
#### 26. Which files contain user account information? (choose two)
* /etc/passwd
* /etc/shadow
#### 27. Which command will display the UID, GID and groups your current user belongs to?
* id
#### 28. Each user belongs to at least one group. True or False?
* True
#### 29. Which command will display the users that are currently logged in to the system?
* who
#### 30. Which command will display the groups that the root user belongs to?
* id root
#### 31. UIDs 1-499 are usually reserved for what kind of users?
* System accounts, such as server processes
#### 32. Which of the following options for the useradd command allows root to specify the UID to be associated with the account?
* -u
#### 33. Which command can be used to determine a user’s most recent log in?
* last
#### 34. Which of the following files contains encrypted user password information?
* /etc/shadow
#### 35. Which of the following options for the useradd command allows you to use a different primary group then the default?
* usermod
#### 36. Which of the following commands can be used to modify a user
* usermod
#### 37. Which of the following are methods for setting permissions using the chmod command? (choose two)
* symbolic
* octal
#### 38. The chown command can be used to change the owner and group of a file. True or False?
* True
#### 39. The chmod command can be used on a file by:
* The file owner and root
#### 40. The “execute” permission is never set on files by default. True or False?
* False 
#### 41. The “sticky bit” permission…
* …prevents others from removing files they don’t own from a common directory.
#### 42. The “setuid” permission…
* …allows a command to be run as the file owner.
#### 43. The “setgid” permission… (choose two)
* …allows files created in a directory to be owned by the group that owns the directory.
* …allows a command to be run as the group owner of the file.
#### 44. Which of the following ls commands, when executed, will only show information about the directory itself? (choose two)
* ld -d
* ls -ld


## Linux Essentials comprehensive Exame 1-18
### Embedded Systems means:
* Systems designed to do a specific task on hardware optimized for only that purpose

### Linux originally only ran on:
* Intel 386 PCs

### Bundling utilities, management tools, and application software with a Linux kernel is called a:Bundling utilities, management tools, and application software with a Linux kernel is called a:
* A distribution of Linux

### A software release cycle describes:
* How often upgrades come out for software

### Apple’s OS X is:
* A fully certified UNIX distribution
* Tightly integrated with Apple hardware
* Partially based on code from the FreeBSD project

### Microsoft Windows:
*  Is generally backwards compatible with previous versions
* Offers both desktop and server products
* Has a scripting environment called PowerShell
* 
### An interpreted programming language:
(choose two)
* Is converted into machine specific instructions as the program runs
* Tends to offer more features than compiled languages


### The two main families of Linux shells are:
* Bourne Shell
* C shell

### In virtualization, what are the host and guest?
* The host is the machine that runs the virtual machines
* A guest is a virtual machine

### Cloud computing is:
* All are correct

### Which of the following are properties of a strong password?
* Includes symbols
* At least 10 characters long
* A mix of upper and lower case

### A license where you don’t have access to the source code is called:
* Closed source

### A copyleft provision in a software license means:
* If you redistribute the software, you must distribute the source to any changes you make

### The Free Software Foundation believes that:
* Software should be free to share
* Software should be free to modify
* 
### What does it mean when a work is placed in the public domain?
* The author has relinquished the copyright on the work


The semicolon (;) can be used to separate multiple commands to be executed in order.
True or False?

    True
  

To be able to output messages to the screen, use the _______ command:


    echo
 

The _______ command will print a list of the commands that you’ve previously executed.

  
    history

HOME is an example of _________.

 
    An environment variable
 
The directory where additional documentation for software packages most likely can be found is:


    /usr/share/doc

To start searching a man page, the first key you press is:

    /


To get help on using the info command, execute:
(choose two)

    man info
    info info


The _____ command can be used to find any file, not just commands or man pages.


    locate


Hidden files are files that begin with what character?

    A period (.)
  
The top-level directory on a Linux system is represented as:

    /
   

The ls command without options or arguments…

    …prompts for a directory to list.
    …lists the contents of the current directory.
    …lists the contents of a user’s home directory.
    …generates an error as this command requires arguments.

The command ls -S will sort files:

  
    By size, largest to smallest

When using the cp command, you must provide both a source and a destination.
True or False?

    True


Which option can be used with the rm command to prompt before deleting?


    -i

Which command would list files that do not begin with a “T” or a “W”?

    echo /etc/[!TW]*


In general, for which of the following would you want to use lossless compression?


    A log file


You type gzip myfile.tar. What happens?
(choose two)

    myfile.tar is removed

    myfile.tar.gz holds a compressed version of myfile.tar

Which command will show what is inside the compressed tarball with a name of foo.tar.gz?

  
    tar –tzf foo.tar.gz


By default, the zip command replaces uncompressed files with compressed files.
True or False?

    True
  

Error messages generated by commands are sent where by default?


    STDERR

Which of the following commands will display only lines that begin with test?


    grep ^test file.txt

Which of the following commands will display lines that contain either start or end?

    egrep ‘start|end’ file.txt


A file begins with #!/bin/csh. This means:

 
    Running the script will invoke /bin/csh to interpret the rest of the file

Most of nano’s commands take the form of:


    Control and another character

The if command looks for what exit code to consider a condition to be true?


    0
  
The number of users logged in is in a variable called USERS. How would you test to see if 5 users are logged in?

    test $USERS –eq 5


Which of the following are valid partitioning types?
(choose two)

 
    MBR
    GPT


Software that allows hardware devices to communicate with the installed operating system is called?

    Drivers

Which of the following commands will check hard disk GPT partitions?
(choose three)


    sgdisk
    gdisk
    cgdisk


The process (ps) command shows only processes running in the current shell by default.
True or False?

    True

The free command outputs statistics about:

    Memory usage


Which file contains the information passed to the kernel at boot time?


    /proc/cmdline

To make changes permanent for kernel parameter files found under /proc/sys, the following file can have entries added to it:


    /etc/sysctl.conf

Which of the following commands will display the IP address on a Linux system?

    ifconfig


The RSA key fingerprint allows the dig command to connect to remote systems.
True or False?

  
    False

When issuing the service network restart command, which of the following occurs?

    …takes down all network interfaces, re-reads all related configuration files and then the networking for the system is restarted.


Which of the following commands can be used to display socket statistics, and supports all major packet and socket types?


    ss

Which of the following commands will display the groups that the user bob belongs to?


    id bob


Traditional UNIX systems allowed users to belong to how many groups?


    16

A value of 0 in the “minimum” password aging field means the user cannot change their password.
True or False?

 
    False

Sudo privileges allow users to execute commands as another user.
True or False?

    True


The first line of this command displays how long the system has been running since being rebooted.


    w
  

Which option for the usermod command can be used to specify a user’s group ID (either primary or secondary)?
(choose two)

    -g
    -G

The groupmod command can be used to add users to a group.
True or False?


    False

Which of the following files contains user IDs?

    /etc/passwd


Which of the following commands, run as root, will prevent the user bob from logging in?

    usermod -L bob
 

What directory contains a user’s home directory?

    /home

GIDs under 500 (or 1000) are usually reserved for what kind of groups?


    System use

A user cannot delete a file if they do not own it.
True or False?


    False

The chown command permits changing group ownership done by root only.
True or False?

    True
    False

Which of the following commands will list hidden files as well as their ownership?


    ls -la

Which of the following commands will set setuid for /usr/bin/program?


    chmod 4755 /usr/bin/program


Setting setgid on a directory…


    …will set the group owner of all files created in the directory to the group owner of the directory.
    
Deleting a source file will break an associated hard link.
True or False?

    False

Which of the following commands would create a hard link, link to file?

    ln file link





## Linux Unhatched
#### 1. What does CLI stand for?
* Command Line Interface

#### 2. Commands are case-sensitive. True or False?
* True

#### 3. When entering a command, do arguments or options typically come first?
* Options

#### 4. Which of the following is NOT a correct way to combine options?
* -r l

#### 5. Which command will print your current location in the filesystem?
* pwd

#### 6. Which command will allow you to change your current directory?
* cd 

#### 7. Which of the following is NOT an example of an absolute path?
* Documents

#### 8. Which of the following is NOT an example of a relative path?
* /home

#### 9. The ~ (tilde) character is used to represent:
* A user’s home directory

#### 10. The .. (double period) characters are used to represent:
* The directory above the current 

#### 11. The . (period) character is used to represent:
* The current directory

#### 12. The ls command without options or arguments…
* …lists the contents of the current directory.

#### 13. The first character in a long listing ls -l indicates:
* File Type

#### 14. Which option to the ls will sort the output by file size?
* -S

#### 15. Which of these commands will create a new shell logged in as the root user
* su

#### 16. Which of the following sets has the owner permissions highlighted?
* [rw-]rw-r--

#### 17. Which of the following sets has the group permissions highlighted?
* rw-[rw-]r--

#### 18. Which of the following sets has the other permissions highlighted?
* rw-rw-[r--]

#### 19. Which command will allow a user to change the permissions of a file?
* chmod

#### 20. Which of the following permission sets indicates the other owner has only the read permission?
* rw-rw-r–

#### 21. Which of the following commands is used to change the ownership of a file?
* chown

#### 22. Changing the user owner of a file requires administrative access. True or False?
* True

#### 23. Which of the following commands can be used to rename a file?
* mv

#### 24. The mv command requires at least two arguments. True or False?
* True

#### 25. Which command can be used to copy a file?
* cp

#### 26. The cp command requires at least two arguments. True or False?
* True

#### 27. Which command is used to copy files at the bit level?
* dd

#### 28. The rm command requires at least two arguments. True or False?
* False

#### 29. Which option to the rm command will allow a user to delete directories?
* -r

#### 30. Which of the following commands is used to filter text?
* grep

#### 31. Which of the following commands will return only lines that begin with test?
* grep ‘^test’ file.txt

#### 32. Which of the following commands will return only lines that end with test?
* grep ‘test$’ file.txt

#### 33. Which of the following lines would be NOT returned by the grep ‘[^0-9]’ file.txt command?
* 3121991

#### 34. Which of the following lines would be returned by the grep ‘b[oe]t’ file.txt command?
* bet

#### 35. Which of the following commands will NOT shutdown the system immediately?
* shutdown now

#### 36. Which of the following commands can be used to display network configuration information?
* ifconfig

#### 37. Which of the following commands will display every process?
* ps -e

#### 38. The ps command requires administrative access. True or False?
* False

#### 39. Which of the following commands will update all packages?
* apt-get upgrade

#### 40. Which of the following will delete all of a package’s files?
* apt-get purge

#### 41. Which of the following commands should be executed before installing a package?
* apt-get update

#### 42. Users can update their own passwords. True or False?
* True

#### 43. The root user can change the password of any user. True or False?
* True

#### 44. Which option can be used to view status information about the current user’s password?
* -S



## Teste ano passado 1

### 45. Which option of the head command will display only the first six lines of a file? (choose two)
* -n 6

### 46. For traditional init, the _____ file is where the initial default runlevel is defined.
* /etc/inittab

### 47. Shell variables are used to:
* Hold critical system information

### 48. What does the vertical bar | character do in a regular expression?

* separate alternative patterns that can be matches

### 49. When viewing a file with the ls -l command, which character represents a file type of soft link?
* 1

### 50. Container technology allows system designers to bypass traditional operating systems.
* True

### 51. Which directories are typically writable to all users? (choose two)
* /var/tmp
* /tmp

### 52. Which command will find all processes owned by user fred?
* pgrep -u fred -l

### 53. For the rwxr-x--x permission set, the permissions corresponding to the three characters in the middle belong to:
* The group owner of the file

### 54. Which type of link can be made to directories, hard or soft?
* soft

### 55. Which of the following are valid Linux bootloaders? (choose two)
* GRUB
* LILO

### 56. To use extended regular expressions, you can use: (choose two)
* grep -E
* egrep

### 57. Which command will uncompress the file letters.txt.xz?
* unxz letters.txt.xz

### 58. Which of the following commands is used to view the summary of CPUs in the system?
* lscpu

### 59. For rwxr-x--x permission set, the permissions correponding to the last 3 characters (rightmost) belong to:
* All users besides the user owner and group owner


## HTML 5
### 60. To execute a command called "cmd1" as a foreground process, you would type:
* cmd1

### 61. In GRUB Legacy, the _____ directive defines an operating system to boot.
* title

### 62. The mv command will rename a file when a new directory is not specified.
* True

### 63. Assuming everyone has access to the directory the file is in, who can view the contents of a file with permissions of rw-r----x?
* Both the user owner and group owners

### 64. After running fdisk -cu /dev/sdb, what fdisk command will allow you to create a new partition?
* n

### 65. What is the real location of the GRUB Legacy configuration file?
* /boot/grub/grub.conf

### 66. What directory contains information about symbolic links that enable services?
* /usr/lib/systemd

### 67. Inodes are used to store a file's:
* Metadata

### 68. Virtualization software comes in both paid and open source variants:
* True

### 69. If you have a file named /tmp/hosts pointing to a file named /etc/hosts and the /etc/hosts file is deleted, then which of the following statements is true?
* The /tmp/hosts file now points to nothing

### 70. Which of the following commands can be used to scroll through a text file?
* less

### 71. The rpm2cpio command can be used to: (choose two)
* List the content of a “.rpm” file
* Extract files from a “.rpm” file

### 72. Which directory is used for the home directory of the root user?
* /root

### 73. Missing files don't have their original file names, instead they are named with their _____ number?
* inode

### 74. After running fdisk -cu /dev/sdb, what fdisk command will allow you to list the current partition table?
* p



#### To see a list of commands that are available while viewing a man page, you can type the __ character.
* h

#### The glob pattern [a-d] would match:
* A file name with a single character that is either a “a”, “b”, “c”, or “d”.

#### You can combine glob characters in a single pattern, for example: a??*[0-9]
* True

#### To save and then quit, you can type in command mode:
* :wq

#### Which type of link can be made to a file on another filesystem, hard or soft?
* soft

#### Which of the following is a non-interactive editor?
* sed

#### Which option to the bzip2 command can be used to report the compression ratio of an archive?
* -v

#### Which option to the df command shows how many inodes are free in a filesystem?
* -i

#### If you are in vi command mode and want to add a new line after your cursor, you can type:
* o

#### Which directory represents the root of the filesystem hierarchy?
* /

#### Which utility can automate changes needed for a base virtual machine image?
* cloud-init

#### Which command is used to change permissions on a file?
* chmod

#### Which directory is used to store essential libraries?
* /lib

#### Which of the following files is for all bash shell users and executed only at login?
* /etc/profile

#### What version of GRUB is the most modern version?
* GRUB 2

#### Which regular expression character matches any one character?
* .

#### Which of the following will create a variable?
* variable=value

#### What directory is used as a temporary mount point?
* /mnt

#### A bare-metal hypervisor runs directly on top of physical hardware
* True

#### The command, chmod 0777 /data will:
* Remove all special permissions

#### Which of the following are benefits of a shared library: (choose two)
* Programs can be smaller
* Programs use a more consistent base of code

#### The key press combination that will request a process to stop is:
* CTRL+C

#### What commands can display a list of mounted file systems? (choose two)
* mount
* df

#### If you want to move a character to the right in vi command mode, you can press the Right Arrow Key → or:
* l


#### Environment variables are:
* Passed into other shells and commands


#### Which directory is used to store files representing attached devices?
* /dev

#### Which of the following contents is in the ldconfig configuration file by default?
* include ld.so.conf.d/*.conf

#### Which glob character matches zero or more characters?
* \*

#### What option to the mkfs command allows you to specify the type of filesystem to create?
* -t

#### The screen command can detach and re-attach terminal sessions.
* True

#### To perform cut and paste in a vi document, you actually do:
* delete and put

#### Which two directories are automatically searched for shared libraries? (choose two)
* /lib
* /usr/lib

#### To view the contents of foo.gz without uncompressing it, use:
* zcat foo.gz

#### What is the notification mechanism used to inform programs about a change in state of hardware devices?
* HALD uses dbus to send notifications

#### The _____ command will display how much space a filesystem has free?
* df

#### Which command will display UUIDs?
* blkid

#### A pair of single quotes ' will prevent the shell from interpreting any special character.
* True

#### When you create a hard link, it increases the hard link count by one.
* True

#### Instead of using traditional runlevels, Systemd uses:
* Targets

#### If you are in the vi command mode and want to begin inserting text before your cursor, you can type:
* i

#### What option to the fdisk command is used to display current partitions?
* -l

#### The same set of services are started or stopped at different runlevels.
* False

#### By default the gzip command replaces uncompressed files with compressed files.
* True

#### In GRUB Legacy, the _____ directive indicates how long to wait before automatically booting the default operating system.
* timeout=

#### The two login types are:
* CLI and GUI

#### Which option to the find command will search by file type?
* -type

#### Which command is used to create a physical volume?
* pvcreate

#### Which character at the beginning of a long listing indicates a directory?
* d

#### To execute a command with the highest possible priority, which value do you pass to the nice command?
* -20

#### Using the setgid permission on a directory:
* Causes new files created in the directory to be owned by the group that owns the directory

#### The mkdir command cannot be used to:
* Delete a directory

#### Which programs have emerged to compete with and replace the traditional init process:
* Systemd
* Upstart

#### Bundling utilities, management tools, and application software with a Linux kernel is called a:
* A distribution of Linux

#### Which two characters represent the empty string?
* ""

#### Which directories exist in the /etc/rc.d directory?
* rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d and rc6.d

#### Which of the following are considered replacements for the traditional init process?
* Sysinit
* Systemd

#### Which of the following is not used for globbing?
* \#

#### If you want to unmount a partition, which command should you use?
* umount

#### Which command is used to view the services that are set to start or stop automatically?
* chkconfig

#### Assuming at least one file matching the pattern is in the current directory, the command echo ???a will display:
* All of the files in the current directory that have four characters in the file name with the last character being an "a" character.
