Home » LPI » 117-201 » Which of the following commands in your .profile would make it obvious to which server you are attached?
You telnet into several of your servers simultaneously. During the day, you sometimes get confused as to which telnet session is connected to which server.
Which of the following commands in your .profile would make it obvious to which server you are attached?
A. PS1=’h: w>’
B. PS1=’s: W>’
C. PS1=’!: t>’
D. PS1=’a: n>’
Correct Answer: A
Explanation/Reference:
Explanation: The PS1 environment variable controls the prompt on the command line, and can be used by users to tell what system they are on, the directory they are currently in, the current date and more depending on how this variable is configured. The h option is used to specify the hostname and the w option will give the full path of the current working directory.
Reference: http://ctdp.tripod.com/os/linux/tips/tipsps1.html
Incorrect Answers:
B:The s option is used to display the shell name. This won’t give any indication of which machine you are connected to.
C:The option is used to display the history number of the current command. This won’t give any indication of which machine you are connected to.
D:The a option is used to display a new line. This won’t give any indication of which machine you are connected to.
Download Printable PDF. VALID exam to help you PASS.
|
|