This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

CLI Magic: Use ANSI escape sequences to display a clock in your terminal

Posted by: Anonymous [ip: 123.200.203.202] on January 23, 2008 08:32 AM
I like it, but as others have noted, you can just customise your prompt by including the following in .bashrc. I'm fond of this one prompt:

PS1='\[\033[0;32m\]\u@\h\[\033[0m\] \[\033[0;33m\]\w\[\033[0m\]\n\[\033[1;33m\]\@\[\033[0m\]: '


It makes your prompt look like this...


user@host /current/path
07:20 PM: _

In three different colours too.

[[That's not what it looks like - I don't know why this post has no linebreaks.]]

#

Return to CLI Magic: Use ANSI escape sequences to display a clock in your terminal