Solved

bash

Posted on 2006-11-24
4
179 Views
Last Modified: 2010-04-20
hello,
I have modified my /etc/bashrc file and I was wondering if there's a way of showing the time

instead of this
[(11:29 PM)][(root@server)] [(~)] $
to something like this
[(11:29 45 PM)][(root@server)] [(~)] $

this is what I have

    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="\[\033[1;32m\][\[\033[0;32m\](\[\033[1;37m\]\@\[\033[0;32m\])\[\033[1;32m\]]\[\033[1;32m\][\[\033[0;32m\](\[\033[1;37m\]\u\[\033[1;30m\]@\[\033[1;37m\]\h\[\033[0;32m\])\[\033[1;32m\]] \[\033[1;32m\][\[\033[0;32m\](\[\033[1;37m\]\w\[\033[0;32m\])\[\033[1;32m\]] \[\033[1;37m\]\$ "
0
Comment
Question by:Sabrin
  • 2
  • 2
4 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 18010283
What is the 45 supposed to represent?
0
 

Author Comment

by:Sabrin
ID: 18010286
seconds
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 18010296
PS1="[(\D{%I:%m %S %p})][(\u@\h)][(\w)]"
0
 

Author Comment

by:Sabrin
ID: 18010302
what will be the final code?
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now