New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Best Bash Prompt Code
So what PS1 codes do you use use for your VPS? Since I've got a bunch of VPS around the world, I need something to remind me which one I'm in and what system is loaded:
PS1='[\e]0;\w | \u@\h\a][[\e[1;31m]\[email protected](Cent5.10-32bit) [\e[33m]\W[\e[0m]]# '
Looks like this (pretend there are red and yellow colors...):
[[email protected](Cent5.10-32bit) ~]#
Any other 'cool' thing you do in yours?
Comments
nice
I've grown used to root@vps1 time for a change though
ZSH + Powerline anyone?
Shouldn't you be able to tell by the hostname? If not maybe you should revisit your naming scheme.
This, all my boxes have the server location/name in them so I know what box im on.
Have a look at this one - http://www.askapache.com/linux/bash-power-prompt.html
Good idea...I actually don't use the hostname for anything as I do everything off the IP address on all my boxes.
Nifty stuff in there
Dev boxes (green):
PS1='\[\033[01;34m\][\A] \[\033[01;32m\]\u@\[\033[01;32m\]\h\[\033[0m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
Production boxes (red):
PS1='\[\033[01;34m\][\A] \[\033[01;31m\]\u@\[\033[01;31m\]\h\[\033[0m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
I use this, which is the default Gentoo prompt plus some code I borrowed and modified from a blog some time ago to show the current git branch and whether it's clean or dirty. I think it was this article but apparently I didn't document the URL at the time.
The default Gentoo prompt is nice because it's green when you're a regular user and red when you become root.
The git branch turns yellow if it's dirty or cyan if it's clean. If you're not in a git branch, the indicator goes away so it just looks like the default Gentoo prompt again.
excellent link. thanks
can you please share your zshrc with us?
thank you
https://github.com/robbyrussell/oh-my-zsh
https://github.com/robbyrussell/oh-my-zsh/wiki/themes <- agnoster
You need to use one of these fonts https://github.com/Lokaltog/powerline-fonts to get it working.
My zshrc (nothing special, oh-my-zsh does all the fancy stuff) https://files.botox.bz/dotfiles/zshrc