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




















Recent comments
3 years 38 weeks ago
3 years 39 weeks ago
3 years 39 weeks ago
3 years 51 weeks ago
3 years 51 weeks ago
4 years 1 day ago
4 years 4 weeks ago