Fancy and Colorful Command Prompt

Share here your personal tips or creations: desktop, conky, docks, widgets or tweaks are welcomed here!
Deleted User 2764

Fancy and Colorful Command Prompt

Postby Deleted User 2764 » 11 May 2014 17:54

This is not my tweak but an article that Linux Foundation tweeted about and thought I'd share here: ... -in-linux-

Personally I don't know if I would do this as I'm into a more "plain" prompt that is short as possible, but for those who like a little more pizzaz and information, this is kinda neat!

User avatar
Posts: 52
Joined: 27 Sep 2014 19:35
Location: Chepstow, UK

Re: Fancy and Colorful Command Prompt

Postby Nuke » 01 Oct 2014 21:55

I have tweaked my CLI prompt ever since I used DOS, but I do it for function, not pizzaz. My requirements are :

1) To see who I am and where I am (I can log under several names and be in sessions on other machines)

2) To see clearly the current directory (otherwise I would be forever typing pwd). To separate from (1) this to be in a different colour.

3) To be very clear indeed if I am in a superuser session, so different colour again (red for warning).

4) To throw a blank line before each prompt to make it easy to look back through a session.

5) To put a space between the prompt symbol and what I type and for what I type to be a different colour again from anything in the prompt.

The different colours I use are only mildly different from each other, like green/cyan so nothing eye-watering (except the su's red).

I notice in the link that their prompt has date and time in it. What a waste of line-length! If I want to know the time I glance at the clock over my desk, and I don't know why anyone would need to be told the date every few seconds. Otherwise just type "date". I believe this is a hangover from the early days when people were impressed by a computer being able to tell the time.

My current set-up is :

My user :-

Code: Select all

PS1='${debian_chroot:+($debian_chroot)}\n\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w \[\033[00m\]\$ '
Root :-

Code: Select all

 PS1='\n\[\e[1;31m\][\u@\h:\[\e[1;36m\]\w] \[\e[1;31m\]\$\[\e[0m\] '
To try these, just start a bash session and paste them in as a command.

Return to “Customizations”

Who is online

Users browsing this forum: No registered users and 1 guest