S
S
Sdelan_v_CCCP2014-10-21 09:55:10
linux
Sdelan_v_CCCP, 2014-10-21 09:55:10

How to change the greeting in bash?

After starting the terminal, I have something like this greeting Between the colon and the $ sign, the current directory is always displayed. Which configuration file is responsible for generating the greeting? I'm going to do the same for a friend of mine.
username@comp:~$

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey Petrikov, 2014-10-21
@Sdelan_v_CCCP

I give my version, just drive in the terminal:

PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;30m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\]'

M
Maksim Zverev, 2014-10-21
@m1skam

~/.bashrc is responsible for prompt
Read: www.linux.com/learn/tutorials/772396-how-to-make-a...
Generator: https://www.kirsle.net/wizards/ps1.html

M
Mark Rosenthal, 2014-10-21
@font

vi /etc/motd
Did you mean it?fabc7f13596543e49b1f9d558eb942a0.png

M
Maxim_Q, 2019-04-23
@Maxim_Q

here is my option. It needs to be placed in the .bash_profile file in the user's directory, and in the user's /root/ directory

PROMPT_COMMAND='echo -en "\033]0;${USER}@${HOSTNAME}  ${PWD}\007"'
PS1='\[\033[0;36m\]\t\[\033[38;05;28m\] :: ($?) ===============================================================\n\n\n\[\033[1;35m\]\[email protected]\H\[\033[1;33m\] \w \[\033[1;32m\]\$\[\033[00m\] '
PS2='\[\033[38;05;46m\]  > \[\033[00m\]'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question