bash

  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/sparxsys_linux/www.linuxindya.com/includes/file.inc on line 647.
  • warning: Creating default object from empty value in /home/sparxsys_linux/www.linuxindya.com/modules/taxonomy/taxonomy.module on line 1388.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.
  • : preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/sparxsys_linux/www.linuxindya.com/includes/unicode.inc on line 311.

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