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?

A.

Retype the command, and be sure you type the filename correctly, letter by letter.

B.

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.

C.

Press the Up arrow key, and use bash’s editing features to correct the typo.

D.

Any of the above.

E.

None of the above.

Answer & Explanation

Report

Answer : [D]Explanation :

Any of these approaches will work, or at least might work. (You might err when
performing any of them.) Option B or C is likely to be the most efficient approach; with a
long filename to type, option A is likely to be tedious.

Report

Name

Email

2.

Which of the following commands is implemented as an internal command in bash?

A.

cat

B.

less

C.

tee

D.

sed

E.

echo

Answer & Explanation

Report

Answer : [E]Explanation :

The echo command is implemented internally to bash, although an external version
is also available on most systems. The cat, less, tee, and sed commands are not
implemented internally to bash, although they can be called from bash as external
commands.

Report

Name

Email

3.

You type echo $PROC, and the computer replies Go away. What does this mean?

A.

No currently running processes are associated with your shell, so you may log out
without terminating them.

B.

The remote computer PROC isn’t accepting connections; you should contact its administrator
to correct the problem.

C.

Your computer is handling too many processes; you must kill some of them to regain
control of the computer.

D.

Your central processing unit (CPU) is defective and must be replaced as soon as possible.

E.

You, one of your configuration files, or a program you’ve run has set the $PROC environment
variable to Go away.

Answer & Explanation

Report

Answer : [E]Explanation :

The echo command echoes what follows to standard output, and $PROC is an
environment variable. Thus, echo $PROC displays the value of the $PROC environment
variable, meaning that it must have been set to the specified value by you, one of your
configuration files, or a program you’ve run. Although many environment variables are set
to particular values to convey information, $PROC isn’t a standard environment variable
that might be associated with information described in options A, B, C, or D.

Report

Name

Email

4.

What does the pwd command accomplish?

A.

It prints the name of the working directory.

B.

It prints wide displays on narrow paper.

C.

It prints wide displays on narrow paper.

D.

It parses Web page URLs for display.

E.

It prints the terminal’s width in characters.

Answer & Explanation

Report

Answer : [A]Explanation :

The pwd command prints (to standard output) the name of the current working
directory. The remaining options are simply incorrect, although option B describes the cd
command, and various tools can be used to reformat wide text for display or printing in
fewer columns, as in option C.

Report

Name

Email

5.

In an xterm window launched from your window manager, you type exec gedit. What will
happen when you exit from the gedit program?

A.

Your shell will be a root shell.

B.

The gedit program will terminate, but nothing else unusual will happen.

C.

Your X session will terminate.

D.

The xterm window will close.

E.

A new instance of gedit will be launched.

Answer & Explanation

Report

Answer : [D]Explanation :

The exec command causes the rest of the command to replace the current shell.
Thus, when you exit from gedit in this scenario, the result will be the same as if you’d
terminated the shell; namely, the xterm window will close. The exec command doesn’t
raise the execution privilege, so option A is incorrect. (The su and sudo commands can
raise execution privilege, though.) Because the xterm window closes, option B is incorrect.
X won’t ordinarily terminate when a single xterm does, and definitely not if that xterm
was launched from a window manager, so option C is incorrect. The exec command does
not cause re-execution of the command after the first instance terminates, so option E is
incorrect.