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

Descripción

Test sobre Examen 101 - LPI Chapter 1: Exploring Linux Command-Line Tools, creado por Carlos Alberto Jara Alva el 03/01/2018.
Carlos Alberto Jara Alva
Test por Carlos Alberto Jara Alva, actualizado hace más de 1 año
Carlos Alberto Jara Alva
Creado por Carlos Alberto Jara Alva hace más de 7 años
112
0
1 2 3 4 5 (0)

Resumen del Recurso

Pregunta 1

Pregunta
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?
Respuesta
  • 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

Pregunta 2

Pregunta
Which command will display the last lines of the text file file1?
Respuesta
  • head -b file1
  • head --bottom file1
  • head -v file1
  • tail file1
  • tail -n 1 file1

Pregunta 3

Pregunta
Carlos has text file named guest_list containing 12 lines. She executes the following command. What is the result? #split -4 guest_list gl
Respuesta
  • 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

Pregunta 4

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

Pregunta 5

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

Pregunta 6

Pregunta
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?
Respuesta
  • ifconfig < file.txt
  • ifconfig >> file.txt
  • ifconfig > file.txt
  • ifconfig | file.txt
  • ifconfig 2> file.txt

Pregunta 7

Pregunta
What is the effect of the following command? #myprog &> input.txt
Respuesta
  • 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

Pregunta 8

Pregunta
How many commands can you pipe together at once?
Respuesta
  • 2
  • 3
  • 4
  • 16
  • >16

Pregunta 9

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

Pregunta 10

Pregunta
Which of the following commands will print lines from the file world.txt that contain matches to changes and changed'
Respuesta
  • 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)"

Pregunta 11

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

Pregunta 12

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

Pregunta 13

Pregunta
Which of the following shell redirections will write standard output and standard error output to a file named filename?
Respuesta
  • 2>&1 >filename
  • >filename 2>&1
  • 1>&2>filename
  • >>filename
  • 1&2>filename

Pregunta 14

Pregunta
Which variable defines the directories in which a Bash shell searches for executable commands?
Respuesta
  • BASHEXEC
  • BASHRC
  • PATH
  • EXECPATH
  • PATHRC

Pregunta 15

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

Pregunta 16

Pregunta
Which of the following commands replaces each occurrence of 'bob' in the file letter with 'Bob' and writes the result to the file newletter?
Respuesta
  • 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

Pregunta 17

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

Pregunta 18

Pregunta
Which of the following statements is correct regarding the command foo 1>bar?
Respuesta
  • 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.

Pregunta 19

Pregunta
Which of the following commands is implemented as an internal command in bash?
Respuesta
  • cat
  • less
  • tee
  • sed
  • echo

Pregunta 20

Pregunta
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?
Respuesta
  • verbose | quit
  • verbose &> /dev/null
  • verbose 2> /dev/null
  • verbose > junk.txt
  • quiet-mode verbose

Pregunta 21

Pregunta
Which of the following commands will change all occurrences of dog in the file animals.txt to mutt in the screen display?
Respuesta
  • 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'
Mostrar resumen completo Ocultar resumen completo

0 comentarios

There are no comments, be the first and leave one below:

Similar

Ciudades Europeas. Nivel 1
Diego Santos
Goya (1746-1828)
Joaquín Ruiz Abellán
TARJETAS ESTUDIO CUERPOS GEOMÉTRICOS
Ruth Pérez Sánchez
4 PS' DE MARKETING
arezadiareko
Introducción a la Biología
ARMANDO SILVA PACHECO
Clasificación de variables
Rober Sanchez
Cáncer de Mama
Luz Moor
Sistema Cardiovascular
Kevin BD
Declinaciones del Latín
Licha Eliza
Past simple
soy_fihiza