Solved

bash

Posted on 2006-11-24
4
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

617 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