Which escape sequence is used with PS1 to show the hostname of our computer?

KellyPoima

New member
Which escape sequence is used with PS1 to show the hostname of our computer?
A. \n
B. \c
C. \h
D. \e
 
Answer: c
Explanation: Bash uses a number of escape sequences to make our prompt as much information as possible. For example, the \h string will show the hostname of our computer.
Code:
$ PS1=”\h ”
Saturn> _        //Saturn is the machine’s name
 

Tìm kiếm

Back
Top