TrevorH wrote: ↑2020/01/23 08:43:31
why does "Documents" show in the host name, and not some other Directory such as "Downloads."
Because you haven't cd'ed to ~/Downloads. If you had then it would.
I think you're missing the point about $PS1 too. It won't change just because you cd to a different directory. The contents of $PS1 tell bash how to format the command prompt. It says [\u@\h \W]\$ which means set the command prompt to a square bracket followed by the username (\u) then an @ sign, followed by the hostname (\h) and a space then the current working directory (\W) and lastly, close off the square brackets and follow it with a dollar sign.
So if you are logged on as user "joe" on host linux101.example.com and you cd /etc then the prompt in your bash screen will say
[joe@linux101 etc]$
> Because you haven't cd'ed to ~/Downloads. If you had then it would.
>> I cd'ed to ~/Downloads. Closed the terminal then opened the terminal and the terminal had changed back to Documents.
> I think you're missing the point about $PS1 too. It won't change just because you cd to a different directory.
>> No doubt I'm missing "something" on this subject. But I do understand whatever is typed at the terminal with "cd" will not have an permanent effect on the command prompt. I fully understand your point here.
>The contents of $PS1 tell bash how to format the command prompt. It says
[\u@\h \W]\$ which means set the command prompt to a square bracket followed by the username (\u) then an @ sign, followed by the hostname (\h) and a space then the current working directory (\W) and lastly, close off the square brackets and follow it with a dollar sign.
>> Here is what I know: Change 'HOSTNAME'
#vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME="Gateway-centOS-6.10"
NTPSERVERARGS=iburst
#vi /etc/host
Delano@Gateway-CentOS-6.10
$echo $PS1
[\u@\h \W]]\$
You say: > So if you are logged on as user "joe" on host linux101.example.com and you cd /etc then the prompt in your bash screen will say
> [joe@linux101 etc]$
Your point here is true, however, my point is: When I log on as joe the bash screen says [joe@linux 101 Documents]$. I do not need to cd /Documents for the prompt to read [joe@linux101 Documents]$