Examen 101 - LPI Chapter 1: Exploring Linux Command-Line Tools

Descrição

Quiz sobre Examen 101 - LPI Chapter 1: Exploring Linux Command-Line Tools, criado por Carlos Alberto Jara Alva em 03-01-2018.
Carlos Alberto Jara Alva
Quiz por Carlos Alberto Jara Alva, atualizado more than 1 year ago
Carlos Alberto Jara Alva
Criado por Carlos Alberto Jara Alva mais de 6 anos atrás
104
0

Resumo de Recurso

Questão 1

Questão
You type a command into bash and pass a long filename to it, but after you enter the command, you receive a File not found error message because of a typo in the filename. How might you proceed?
Responda
  • Retype the command, and be sure you type the filename correctly, letter by letter
  • Retype the command, but press the Tab Key after typing a few letters of the long filename to ensure that the filename is entered correctly
  • Press the Up arrow key, and use bash's editing features to correct the typo.
  • Any of the above
  • None of the above

Questão 2

Questão
Which command will display the last lines of the text file file1?
Responda
  • head -b file1
  • head --bottom file1
  • head -v file1
  • tail file1
  • tail -n 1 file1

Questão 3

Questão
Carlos has text file named guest_list containing 12 lines. She executes the following command. What is the result? #split -4 guest_list gl
Responda
  • The first four columns in the text are written to new files glaa, glab, glac, and glad
  • The first four columns in the text are written to new files aagl, abgl, acgl and adgl.
  • The lines of guest_list are evenly divided among new files glaa, glab, glac, and glad
  • The lines of guest_list are evenly divided among new files glaa, glab and glac.
  • The lines of guest_list are evenly divided among new files aagl, abgl, acgl and adg

Questão 4

Questão
Which one of the following commands could be used to change all upper-case characters to lowercase in the middle of a pipe?
Responda
  • grep
  • egrep
  • wc
  • tr
  • pr

Questão 5

Questão
What command can display the contents of a binary file in a readable hexadecimal form? Select one.
Responda
  • xd
  • hd
  • od
  • Xd
  • dump

Questão 6

Questão
You want to store the standard output of the ifconfig command in a text file (file.txt) for future reference, and you want to wipe out any existing data in the file. You do not want to store standard error in this file. how can you accomplish these goals?
Responda
  • ifconfig < file.txt
  • ifconfig >> file.txt
  • ifconfig > file.txt
  • ifconfig | file.txt
  • ifconfig 2> file.txt

Questão 7

Questão
What is the effect of the following command? #myprog &> input.txt
Responda
  • Standard error to myprog is taken from input.txt
  • Standard input to myprog is taken from input.txt
  • Standard output and standard error from myprog are written to input.txt
  • All of the above
  • None of the above

Questão 8

Questão
How many commands can you pipe together at once?
Responda
  • 2
  • 3
  • 4
  • 16
  • >16

Questão 9

Questão
Which of the following commands will number the lines in aleph.txt (Select three.)
Responda
  • fmt aleph.txt
  • nl aleph.txt
  • cat -b aleph.txt
  • cat -n aleph.txt
  • od -nl aleph.txt

Questão 10

Questão
Which of the following commands will print lines from the file world.txt that contain matches to changes and changed'
Responda
  • grep change[ds] world.txt
  • sed change[d-s] world.txt
  • od "change'd|s" world.txt
  • cat world.txt changes changed
  • find world.txt "change(d|s)"

Questão 11

Questão
Which of the following regular expressions will match the strings dog, dug, and various other strings but not dig?
Responda
  • d.g
  • d[ou]g
  • d[o-u]g
  • di*g
  • d.ig

Questão 12

Questão
Which of the following files, located in the user home directory, is used to store the Bash History?
Responda
  • .bash_history
  • .bash_histfile
  • .history
  • .bashrc_history
  • .history_bash

Questão 13

Questão
Which of the following shell redirections will write standard output and standard error output to a file named filename?
Responda
  • 2>&1 >filename
  • >filename 2>&1
  • 1>&2>filename
  • >>filename
  • 1&2>filename

Questão 14

Questão
Which variable defines the directories in which a Bash shell searches for executable commands?
Responda
  • BASHEXEC
  • BASHRC
  • PATH
  • EXECPATH
  • PATHRC

Questão 15

Questão
Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log?
Responda
  • cat < myapp | cat > file1.log
  • myapp 0>&1 | cat > file1.log
  • myapp | cat > file1.log
  • myapp | tee file1.log
  • tee myapp file1.log

Questão 16

Questão
Which of the following commands replaces each occurrence of 'bob' in the file letter with 'Bob' and writes the result to the file newletter?
Responda
  • sed '/bob/Bob' letter > newletter
  • sed s/bob/Bob letter > newletter
  • sed 's/bob/Bob' letter > newletter
  • sed 's/bob/Bob/g' letter > newletter
  • sed 's/bob, Bob/'' letter > newletter

Questão 17

Questão
What command will generate a list of user names from /etc/passwd along with their login shell?
Responda
  • column -s : 1,7 /etc/passwd
  • chop -c 1,7 /etc/passwd
  • colrm 1,7 /etc/passwd
  • cut -d: -f1,7 /etc/passwd

Questão 18

Questão
Which of the following statements is correct regarding the command foo 1>bar?
Responda
  • The stdout from the command foo is appended to the file bar.
  • The stdout from the command foo overwrites the file bar.
  • The command foo receives its stdin from the file bar.
  • The command foo receives its stdin from the stdout of the command bar.
  • The stderr from the command foo is saved to the file bar.

Questão 19

Questão
Which of the following commands is implemented as an internal command in bash?
Responda
  • cat
  • less
  • tee
  • sed
  • echo

Questão 20

Questão
A text-mode program, verbose, prints a lot of bogus "error" messages to standard error. How might you get rid of those messages while still interacting with the program?
Responda
  • verbose | quit
  • verbose &> /dev/null
  • verbose 2> /dev/null
  • verbose > junk.txt
  • quiet-mode verbose

Questão 21

Questão
Which of the following commands will change all occurrences of dog in the file animals.txt to mutt in the screen display?
Responda
  • sed -s "dog" "mutt" animals.txt
  • grep -s "dog || mutt" animals.txt
  • sed 's/dog/mutt/g' animals.txt
  • cat animals.txt | grep -c "dog" "mutt"
  • fmt animals.txt | cut 'dog' > 'mutt'

Semelhante

VESTIBULAR - DICAS
Alessandra S.
Guia de Estudos para OAB 1a Fase
Maria José
Como Estudar Matemática
Alessandra S.
Endemia - Verminoses brasileiras II
Bruno Fernandes3682
O efeito estufa
guilhermetcortes
Phrasal Verbs - Inglês #1
Eduardo .
Expressões em inglês #6
Eduardo .
Citologia
Thamy Procopio
Apresentação da aula 1 - Desenvolvimento Humano e Social - Saúde
Emmanuela Pimenta
Citações para Redação - ENEM
Jayne Torres