BASH - Display date/time, hostname and current directory
Submitted by ravisagar on Mon, 04/28/2008 - 08:32.
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.
- ravisagar's blog
- Add new comment
- 9785 reads




















Recent comments
2 years 11 weeks ago
2 years 12 weeks ago
2 years 12 weeks ago
2 years 24 weeks ago
2 years 24 weeks ago
2 years 25 weeks ago
2 years 29 weeks ago