how do i change "bash-4.1#" to "user@hostname
as title says really distro version is 13.1,
google has failed me an new to slack many thanks in advance rev.dr.rich |
set PS1 variable in your .bashrc in ~/home/user directory
Code:
#--------------------- |
better readable:
Code:
function set_prompt () { |
You might want to read /usr/doc/Linux-HOWTOs/Bash-Prompt-HOWTO
|
Hi,
Since you want to modify '.bashrc' then you could setup a .bashrc & .bash_profile for your user. Just modify the PS1 to suit; Code:
sample .bash_profile; Code:
Code:
sample .bashrc; Bash Reference Manual & Advanced Bash-Scripting Guide along with Rute Tutorial & Exposition should provide additional help. |
Quote:
|
ok, to be honest i don't understand how the provided codes can change bash to user@... please can someone run it by me as it seems this only colourises the terminal to which i have got it coloured already."god i've got to use to babysitting distro's like ubuntu, lol"
|
Code:
PS1="\[\033[35m\]\[\033[36m\]\w\n\[\033[0;31m\]\u@\h\[\033[1;34m\] ~\[\e[1;32m\]> \[\e[m\]\[\e[0;37m\]\[\033[0m\]" Quote:
|
aargh!
nuts. I goofed. can someone delete this post?
|
You could try setting the hostname like this: hostname <newname> <rtn>
Then you can add users like this: adduser <myusername> <rtn> Of course, you can also do it as posted above, but this always seemed easier to me than digging out a file and editing it. When adding usernames, you'll likely get a menu of things to add or do. If you don't know what you're doing at the command line with this, you can garf something up pretty quick, but re-installing hasn't ever been a big deal to me, as I do this just to fiddle with things here. After executing these two commands, you should re-boot. You'll then see your login with your new hostname. |
i already have users an hostname set up but they do not display on my terminal.
|
Quote:
EDIT; i didn't have a bash rc so created a new one wih your provided code an was intending to edit the colour but even better the colour work nicely with my "terminal-colours" theme an as asked my prompts are back to something i can use (not knowing which terminal was in root at the time was most confusing, thankyou |
This is all you need:
Quote:
|
PS1='[\u@\h:\W]\$ '
short, simple, informative. |
Quote:
i have just downloaded the o'reilly bash quick reference an so far have the first 18 pages printed out, so fingers crossed i may be able (eventually) to make possibly usefull scripts to be shared. also i like you signature. |
All times are GMT -5. The time now is 10:33 AM. |