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
- 341 reads














Recent comments
4 weeks 5 days ago
7 weeks 6 days ago
8 weeks 3 days ago
8 weeks 3 days ago
20 weeks 4 days ago
20 weeks 4 days ago
21 weeks 3 days ago
25 weeks 6 days ago