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

Beschreibung

Quiz am Examen 101 - LPI Chapter 1: Exploring Linux Command-Line Tools, erstellt von Carlos Alberto Jara Alva am 03/01/2018.
Carlos Alberto Jara Alva
Quiz von Carlos Alberto Jara Alva, aktualisiert more than 1 year ago
Carlos Alberto Jara Alva
Erstellt von Carlos Alberto Jara Alva vor fast 7 Jahre
105
0

Zusammenfassung der Ressource

Frage 1

Frage
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?
Antworten
  • 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

Frage 2

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

Frage 3

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

Frage 4

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

Frage 5

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

Frage 6

Frage
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?
Antworten
  • ifconfig < file.txt
  • ifconfig >> file.txt
  • ifconfig > file.txt
  • ifconfig | file.txt
  • ifconfig 2> file.txt

Frage 7

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

Frage 8

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

Frage 9

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

Frage 10

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

Frage 11

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

Frage 12

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

Frage 13

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

Frage 14

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

Frage 15

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

Frage 16

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

Frage 17

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

Frage 18

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

Frage 19

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

Frage 20

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

Frage 21

Frage
Which of the following commands will change all occurrences of dog in the file animals.txt to mutt in the screen display?
Antworten
  • 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'
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Zeiten Englisch
Janine Egli
Checkfragen - Kapitel 1: Empirische Sozialforschung und empirische Theorie
Melanie Najm
Phyikum (Biologie/ Biochemie)
anna.grillborzer0656
A2 Konjunktiv Präteritum (hätte / wäre)
Anna Kania
Flipped Classroom Modell
Laura Overhoff
M1, Kurs 2: Einführung in die Forschungsmethoden - Unit 1 - Psychologie als eine empirische Wissenschaft: Warum brauchen wir Forschungsmethoden?
Chris Tho
KSOZ Grimm
Markus Gio
EC Klinische Psychologie
Sandra S.
BAS 7 - Schwimmen, Turnen, Leichtathletik
B G
Vetie Histopathologie 2013
Cedric-Bo Lüpkemann