Ensurepass

QUESTION 31

 

A. administrator is writing text in vi. Now the administrator wants to save their changes and exit. Which of the following sequence of inputs will accomplish this? (Select TWO).

 

A. esc ZZ

B. ctrl :w!

C. esc zz

D. esc :wq!

E. ctrl XX

 

Answer: A,D

 

 

QUESTION 32

While editing a file in vi, an administrator realizes that the wrong file is being changed. Which of the following vi command sequences will allow the administrator to quit without saving any changes?

 

A. :Q!

B. :q!

C. :w!

D. :wq!

 

Answer: B

 

 

QUESTION 33

In the command foo < bar | foobar, which of the following statements is correct?

 

A. The stdout from the command foobar is saved to the file foo.

B. The stdout from the command foo is saved to the file foobar.

C. The command foobar receives its stdin from the stderr of foo.

D. The command foobar receives its stdin from the stdout of foo.

E. The command bar receives its stdin from the contents of the file foobar.

 

Answer: D

 

 

QUESTION 34

Which of the following is the output when the below shell script executes? cat <<foobar Hello foobar foobar

 

A. The contents of the file foobar

B. Hello

C. No output but a file named foobar is created

D. Hello foobar

E. Hello foobar foobar

 

Answer: D

 

 

QUESTION 35

All of the following commands will execute the bash script /usr/local/bin/runme.sh EXCEPT:

 

A. source /usr/local/bin/runme.sh

B. . /usr/local/bin/runme.sh

C. /bin/bash /usr/local/bin/runme.sh

D. /usr/local/bin/runme.sh

E. run /usr/local/bin/runme.sh

 

Answer: E

 

 

QUESTION 36

Which of the following commands will change all CR-LF pairs in an imported text file, userlist.txt, to Linux standard LF characters and store it as newlist.txt?

 

A. tr ‘rn’ ” < userlist.txt > newlist.txt

B. tr -c ‘nr’ ” < newlist.txt > userlist.txt

C. tr -d ‘r’ < userlist.txt > newlist.txt

D. tr ‘r’ ‘n’ userlist.txt newlist.txt

E. tr -s ‘^M’ ‘^J’ userlist.txt newlist.txt

 

Answer: C

 

 

QUESTION 37

Bob accidentally created the subdirectory bobsdir in his home directory. He tried to remove the subdirectory with the command rmdir bobsfile only to receive the error, “No such file or directory.” . Which of the following commands will remove the directory?

 

A. rmdir ‘~bob/bobsdir’

B. rmdir “~bob/bobsdir”

C. rmdir ~bob/’bobsdir’

D. rmdir ~bob/bobsdir

E. rmdir ~bob/\bobsdir

 

Answer: E

 

 

QUESTION 38 CORRECT TEXT

 

A. administrator has issued the following command: grub-install –root-directory=/custom-grub /dev/sda In which directory will the new menu.lst file be found? (Provide the full directory path only without the filename).

 

Answer: /custom-grub/boot/grub,/custom-grub/boot/grub/

 

 

QUESTION 39

Many people like the vi text editor but the default bash command line editor recognizes emacs keystrokes. Which of the following commands, entered into a bash initialization file, will have bash recognize vi keystrokes after login?

 

A. history -p vi

B. alias emacs=vi

C. HISTCMD=vi

D. set -o vi

E. unset emacs

 

Answer: D

 

 

QUESTION 40

Which of the following does the Filesystem Hierarchy Standard enable? (Select TWO).

 

A. Software to predict the location of installed files and directories.

B. Software to predict the ownership and access rights to files and directories.

C. Users to predict the location of installed files and directories.

D. Users to predict how the filesystem should be formatted according to need.

 

Answer: A,C

 

 

Comments are closed.