BASH - Display date/time, hostname and current directory

To display date/time, hostname and current directory use the following command in your BASH prompt and press enter.
PS1="[\d \t \u@\h:\w ] $ "
After pressing enter your BASH prompt will look like this.
[Mon Apr 28 14:04:48 ravisa@incgnddw0062:/cygdrive/e/myfiles/] $
I used this command on Cygwin running on Window XP. The hostname and current directory will be different in your case.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.