Solved

bash

Posted on 2006-11-24
4
183 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

713 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