bash

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 \[email protected]\h:\w ] $ "
After pressing enter your BASH prompt will look like this.
[Mon Apr 28 14:04:48 [email protected]:/cygdrive/e/myfiles/] $
I used this command on Cygwin running on Window XP. The hostname and current directory will be different in your case.

Current working directory in BASH

For all those newbies in the world of Linux here is a very useful linux command.

[[email protected] practice]# pwd
/home/ravi/windows/d/myfiles/tutorials/c++/practice

pwd will print the current working directory in the konsole.

Syndicate content