Ensurepass

QUESTION 41

What command would execute cmd1 followed by cmd2, regardless of the exit status of cmd1?

A. cmd1 cmd2

B. cmd1 | cmd2

C. cmd1 ; cmd2

D. cmd1 && cmd2

E. cmd1 || cmd2

Answer: C


QUESTION
42 CORRECT TEXT

You have a text file with tab-separated values, but your application needs them space-separated. What command would you use from the Bash shell to achieve this? Please fill in the command only, without any options.

Answer: expand


QUESTION
43

Which command will print to standard out only the lines that do not begin with # (pound symbol) in the file foobar?

A. /bin/grep ^# foobar

B. /bin/grep -v ^# foobar

C. /bin/grep #$ foobar

D. /bin/grep -v #$ foobar

Answer: B


QUESTION
44

What command will remove duplicate lines from a sorted file?

A. filter

B. trim

C. uniq

D. wc

Answer: C


QUESTION
45

Which command line option would you use to restrict the GNU find command to searching a particular number of subdirectories?

A. –max-dirs

B. -dirmax

C. -maxdepth

D. -s

E. -n

Answer: C


QUESTION
46

What is the disadvantage of using the command kill -9?

A. A core dump file will be created.

B. It affects the entire process group.

C. It makes excessive use of system resources.

D. The action can be blocked by buggy or malicious processes.

E. The affected process is unable to clean up before exiting.

Answer: E


QUESTION
47

To prevent a command run as root from sending both standard out (stdout) and standard error (stderr) to any terminal or other file or device, which of the following strings should be appended to the command?

A. >/dev/null

B. >/dev/null 1>&2

C. >/dev/null 2>&1

D. 1>&2 >/dev/null

E. 2>&1 >/dev/null

Answer: C


QUESTION
48

You want to search the file myfile for all occurances of string containing at least five characters, where character number 2 and 5 are ‘a’ and character number 3 is NOT ‘b’. Which command would you use?

A. grep a*^b*a myfile

B. grep .a[^b].a myfile

C. grep .[a].*.[a] myfile

D. grep .a*^b..a myfile

Answer: B


QUESTION
49

What does the following command do? Cat ‘$TEST’

A. Displays a bash syntax error message.

B. Displays the contents of the file named $TEST if it exists.

C. Waits for the user to enter text and then echos the text back.

D. Displays the contents of the file named inside the back quotes.

E. Displays the contents of the named by the environment variable TEST.

Answer: B


QUESTION
50

You want to the command foo to take its input from the file foobar and send its output to the program bar. Which of the following command lines will do this?

A. foo < foobar | bar

B. foo < foobar > bar

C. foo | foobar > bar

D. foo | bar < foobar

E. foo > bar < foobar

Answer: A

 

Download Latest LPI 117-101 DUMPS Real Free Tests , help you to pass exam 100%.

Comments are closed.