# [ASR] - Teste Linux
## ATENÇÃO! COLOCAR APENAS RESPOSTAS CORRETAS!
**Exemplo:**
A pergunta é qual é a resposta certa?
- Resposta Certa
---
## Links de ajuda (respostas online)
- https://hackmd.io/yFafBBMfQL2CCr5lF1ZDOg (Resolução dos Labs da Bea).
- https://quizlet.com/268065708/linux-flash-cards/ (99 respostas).
- pucourse.com/linux-i-2-0/introduction-to-linux-i-final-comprehensive-exam-chapters-1-26-answers/ (108 respostas).
- https://itexamanswers.net/introduction-to-linux-i-midterm-exam-answers-100-pdf-file-modules-1-14.html (70 respostas).
- https://itexamanswers.net/introduction-to-linux-i-final-comprehensive-exam-answers-100-pdf-file-modules-1-27.html (135 respostas).
---
The two login types are:
- CLI and GUI
The location of users' default shells is stored in the ______ file.
- /etc/passwd
Which of the following is not used for globbing?
- #
In what directory are yum repository configuration files stored?
- /etc/yum.repos.d
Which option to the fsck command will allow you to specify the filesystem type?
- -t
What option to the who command will display the current runlevel?
- -r
Which option to the fsck command forces a system check?
- -f
If you want to move up a line in vi command mode, you can press the Up Arrow Key ↑ or:
- k
Which of the following can be used to view details about USB devices? (choose two)
- usb-devices
- ls -usb
-(ele vai dar como bonus esta, escolham so uma)
Shell variables are used to:
- Hold critical system information
If you want to append content to a file with the normal output of a command, you can use:
- >>
Which command is used from the command line, to edit your disk's partition table?
- fdisk
When specifying a path, the __ character symbolizes the current directory.
- .
Which of the following options puts the cpio command into copy-in mode?
- -i
What commands can display a list of mounted file systems?(2 opcões)
- mount
- df
For traditional init, the _____ file is where the initial default runlevel is defined.
- /etc/inittab
The rpm2cpio command can be used to: (choose two)
- Extract files from a ".rpm" file
- List the content of a ".rpm" file
What directory contains information about symbolic links that enable services?
Selecione uma opção de resposta:
c.
/usr/lib/systemd
Which type of link can be made to a file on another filesystem, hard or soft?
- soft
To execute a command with the highest possible priority, which value do you pass to the nice command?
- -20
A soft link is also called a _____ link.
- symbolic.
Environment variables cannot be created by which command?
- set
Which two commands will show detailed information about a Debian package?
- apt-cache show
- dpkg -s
Which archiving method is compatible across Linux, Microsoft Windows and Mac operating systems?
- zip
Which option to the bzip2 command can be used to report the compression ratio of an archive?
- -v
In a command pipeline, the output of one command is sent to another command as output.
- false
The mkdir command cannot be used to:
- Delete a directory.
Which command is used to view the services that are set to start or stop automatically?
Selecione uma opção de resposta:
* chkconfig
To execute a command called "cmd1" as a foreground process, you would type:
- cmd1
gzip and bzip are aliases for the same utility.
True or False?
- false
The same set of services are started or stopped at different runlevels.
- False
Which of the following are benefits of a shared library: (choose two)
- Programs use a more consistent base of code
- Programs can be smaller
The ls command can list the contents of only one directory at a time.
- False.
Placing an __ character at the end of the command line will put the command in the background.
- &
Which type of link is indistinguishable by programs from regular files, hard or soft?
- Hard
How can you determine the RPM package that owns a file?
- yum provides
How can you remove a package using an rpm command?
- rpm -e
The third stage of the boot process is:
- kernel phase
The setuid permission on a file:
- Causes the file to run under the owner's identity
A device name of /dev/sda1 indicates this partition is on which type of device?
- SATA
To maintain timestamps when using the cp command, use:
- -a
Using the touch command and specifying a nonexistent file...
- creates blank file with that name
The command, chmod a+x will:
- Add execute permissions for the user owner
Which command can an administrator run to rebuild the cache of shared libraries?
- ldconfig
To view all current variables, you can use:
- set
The first stage of the boot process is:
- The firmware (BIOS/UEFI) stage
You wish to see an output of the devices on your system that are block-based. Which of the following will list them out?
- lsblk
Shell command man pages are typically located in section ___.
- 1
If you are in vi command mode and want to begin inserting text at the end of the line, you can type:
- A
Which command can be used to send the output of a command to both stdout and a file
- ls | tee /tmp/output
In GRUB Legacy, the _____ directive indi
es an operating system to boot if the default operating system fails to boot.
- fallback=
Which command will create disk labels on an ext3 filesystem?
- ext3label
(ta mal a resposta é **e2label**)
Which command will remove consecutive duplicate lines from a file?
- uniq
What is the primary configuration file for yum?
- /etc/yum.conf
What version of GRUB is the most modern version?
- GRUB 2
If you want to see the entire contents of a text file, you can use the _____ command:
- cat
Which option for the rm command will cause it to prompt before deleting files?
- -i
Virtualization software comes in both paid and open source variants:
- true
The systemd equivalent of runlevels are called?
- targets
Which option for the rm command will cause it to prompt before deleting files?
- -i
Which of the following is a non-interactive editor?
- sed
Which command is used to view the summary of the RAM and swap space?
- free
To see a list of commands that are available while viewing a man page, you can type the __ character.
- h
Which directory is used to store temporary files?
- /tmp
Which command is used to create a logical volume?
- lvcreate
To activate a swap space that has been initialized, you can execute:
- swapon
Which option to the fsck command forces a system check?
- -f
Container technology allows system designers to bypass traditional operating systems.
- true
Which utility can automate changes needed for a base virtual machine image?
- cloud init (não tenho certeza mas os outros comandos pareciam parvos 95% certeza)
Which command can change the user owner of a file?
- chown
What directory contains information about symbolic links that enable services?
- /usr/lib/systemd
What is NOT a purpose of using parentheses around parts of a regular expression?
- They can be used to change the order that the pattern is evaluating
Integrated peripherals are embedded into the _______ of a system:
- Motherboard
Which command is used to view the summary of the RAM and swap space?
- free
Which Linux distributions are derived from Red Hat?
- fedora
- centOS
The rpm2cpio command can be used to:
- List the content of a “.rpm” file
- Extract files from a “.rpm” file
What is the notification mechanism used to inform programs about a change in state of hardware devices?
- HALD uses dbus to send notifications
Which command is used to create a volume group?
- vgcreate
Which two directories are automatically searched for shared libraries? (choose two)
- lib
- /usr/lib
What is the notification mechanism used to inform programs about a change in state of hardware devices?
- HALD uses dbus to send notifications
Which of the following are benefits of a shared library:
- Programs use a more consistent base of code
Which of the following is not a valid argument for the dd command?
- in
After running fdisk -cu /dev/sdb, what fdisk command will allow you to create a new partition?
- n
A _________ is a location that contains packages and metadata that can be used for queries, installation and updates of software on a system.
- Repository
The /bin directory contains:
- The most fundamental commands that are essential for the operating system to function
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
In GRUB Legacy, the _____ directive indicates an operating system to boot if the default operating system fails to boot.
- fallback=
The ______ command will display your current working directory.
- pwd
To display your current location within the filesystem, you can type:
- pwd
Which character at the beginning of a long listing indicates a directory?
- d
Commands are interpreted by the shell and transformed into actions by the kernel.
- TRue
For traditional init, the _____ file is where the initial default runlevel is defined
- /etc/inittab
Bundling utilities, management tools, and application software with a Linux kernel is called a:
- A distribution of Linux
Which command is used to create a physical volume?
- pvcreate
Which of the following commands can be used to scroll through a text file?
- less
Which directory is used to store temporary files?
- /tmp
If you are in vi command mode and want to add a new line after your cursor, you can type:
- o
Many commands that read text files will also read from this stream:
- stdin
The glob pattern [a-d] would match:
- A file name with a single character that is either a a, b, c, or d.
After running fdisk -cu /dev/sdb, what fdisk command will allow you to list the current partition table?
- p
Which of the following is a non-interactive editor?
- sed
The FHS sets which standard?
- Which directories should be used to hold specific files
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
To see the list of background processes that you have started in your shell, you can run:
- jobs
In what directory are you most likely to find user's home directories?
- home
A mount point is:
- An empty directory that is used to access a filesystem\
The fourth stage of the boot process is:
- init phase
Which two commands will show detailed information about a Debian package? (choose two)
- apt-cache show
- dpkg -s
Virtual memory is also referred to as:
- swap
The key press combination that will request a running process terminate:
- CTRL C
In which file are repositories stored for Debian package management?
- /etc/apt/sources.list
Which of the following will create a variable?
- variable = value
If you want to unmount a partition, which command should you use?
- umount
Using the setgid permission on a directory:
- Causes new files created in the directory to be owned by the group that owns the directory
What are the correct options for the rpm command to display a list of all installed packages?
- -qa
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.
bzip2 archives are typically indicated with which file extension?
- bz2
The group ownership of a file may only be changed by:
- Both the root user and the owner of the file
Which of the following commands is used to view the summary of CPUs in the system?
- lscpu
Which directory is used to store files representing attached devices?
- /dev
Which directory structure contains the bulk of the operating system's files:
- /usr
Which directory structure has directories which may have heavy activity for services like mail, ftp, httpd and printing?
- var
For the rwxr-x--x permission set, the permissions corresponding to the three first characters (leftmost) belong to:
- The user owner of the file
The head -n -1 readme.txt command will:
- Display all but the last line of readme.txt
-
What option to the fdisk command is used to display current partitions?
- -l
To search forward from your cursor in your vi document in command mode, you can type __ followed by the pattern to search for.
- /
A signal is:
- A technique to tell a process to take some sort of action
A pair of single quotes ' will prevent the shell from interpreting any special character.
- true
If you want to append content to a file with the normal output of a command, you can use:
- >>
If a library is not accessible due to an error, the ldd would report which error message?
- not found
This stream is the output of a command operating normally:
- stdout
Which of the following can be used to restart the HTTP service? (choose two)
- service httpd restart
- /etc/init.d/httpd restart
The regular expression a* is equivalent to:
- a{0,}
Which regular expression character matches any one character?
- .
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
What determines how many files can be stored in a filesystem?
- The number of inodes
Which option to the bzip2 command can be used for recursive compression?
- bzip2 doesn't support recursive compression
Which command can change the user owner of a file?
- chown
To switch to another group, you must
- Be a member of the group that you are switching to
Which of the following contents is in the ldconfig configuration file by default?
- include ld.so.conf.d/*.conf
The _____ option to the uname command will display the kernel name.
- -s
To see how long the system has been running, you can use the _____ command.
- uptime
-
Long command options are preceded by which two characters?
- --
By default, the df command displays filesystem use in:
- 1 K blocksize
In GRUB Legacy, the _____ directive defines an operating system to boot.
- title
After running fdisk -cu /dev/sdb, what fdisk command will allow you to list the current partition table?
- p
You can combine glob characters in a single pattern, for example: a??*[0-9].
- true
In order to run a command called "cmd1" in the background, you would type:
- cmd1&
The systemd equivalent of runlevels are called?
- targets (acho que ja aqui tinha psoto esta xD) ass leite rsrsrsrsrsr mais vale a mais TRUEEEE
What commands can display a list of mounted file systems? (choose two)
- mount
- df
The names of hidden files begin with the ___ character.
- .
Which of the following is not a daemon used for logging?
- ilogd (o prof tem lá logd - falta um i)
Which directory is used to store essential libraries?
- /lib
If you want to move a character to the right in vi command mode, you can press the Right Arrow Key → or:
- l
Which command will display more information about globbing?
- man 7 glob
In GRUB Legacy, the _____ directive indicates how long to wait before automatically booting the default operating system.
- timeout=
Which of the following will find and load shared libraries when a program is executed?
- The dynamic linker
A bare-metal hypervisor runs directly on top of physical hardware
- true
What is the primary configuration file for yum?
- /etc/yum.conf
Placing an __ character at the end of the command line will put the command in the background.
- &
To use extended regular expressions, you can use:
- egrep
- grep -E
Which of the following commands could be used to extract the archive, example.tar?
- tar -xf example.tar
A soft link is also called a _____ link.
- symbolic
Which option to the df command shows how many inodes are free in a filesystem?
- -i
Which of the following commands will take the standard output of the echo command and put it into the /tmp/output.txt file:
- echo > /tmp/output.txt
When you create a hard link, it increases the hard link count by one.
- true
The _____ command will search for files using a database of all files, which is generated on demand or scheduled.
- locate
Local variables are:
- Only available to the shell they are created in
The command, chmod 0777 /data will:
- remove all special permissions
Which command can change the user owner of a file?
- chown
Which programs have emerged to compete with and replace the traditional init process:
- upstart
- Systemd
Which directories exist in the /etc/rc.d directory?
- rc0.d, rc1.d, rc2.d, rc3.d, rc4.d, rc5.d and rc6.d
What is the real location of the GRUB Legacy configuration file?
- /boot/grub/grub.conf
The second stage of the boot process is:
- The Bootloader (LILO/GRUB) stage
How can you determine the RPM package that owns a file?
- yum provides
What is the real location of the GRUB Legacy configuration file?
- /boot/grub/grub.conf
To copy the contents of a directory, use the following option(s) for the cp command: (choose two)
- -r
- -R
Environment variables are:
- Passed into other shells and commands
What commands can display a list of mounted file systems?
- mount
- df
The _____ command will display how much space a filesystem has free?
- df
To execute a command with the default priority, which value do you pass to the nice command?
- 0
To search forward from your cursor in your vi document in command mode, you can type __ followed by the pattern to search for.
- /
If you want to initialize swap space that you've just created, which command would you run?
- mkswap
Container technology allows system designers to bypass traditional operating systems.
- true
By default the gzip command replaces uncompressed files with compressed files.
- true
To activate a swap space that has been initialized, you can execute:
- swapon
A device name of /dev/hda1 indicates this partition is on which type of device?
- IDE
Applications make requests to the kernel and receive resources, such as memory, CPU, and disk in return.
- true
What directory is used as a temporary mount point?
- /mnt
Which directory is used primarily for storing log messages?
- /var/log
The mv command will rename a file when a new directory is not specified.
- true
Two or more commands combined with the vertical bar | character between them form a:
- pipeline
Which command will merge two files together line by line?
- paste
What option to the mkfs command allows you to specify the type of filesystem to create?
- -t
The head -n -1 readme.txt command will:
- Display all but the last line of readme.txt
Which of the following files is for all bash shell users and executed every time a bash shell is opened?
- /etc/bashrc
What is the real location of the GRUB Legacy configuration file?
- /boot/grub/grub.conf
Which type of link can be made to directories, hard or soft?
- soft
Which of the following are considered replacements for the traditional init process? (choose two)
- Sysinit
- Systemd
Which command is used to change permissions on a file?
- chmod