-1

I was trying to change the format of my terminal from

john@example.com /home/directory
$

to this:

/home/directory>

Anyone knows how to do it?

I am using unix, xterm.

fedorqui
  • 275,237
  • 103
  • 548
  • 598
ban
  • 605
  • 2
  • 9
  • 22

1 Answers1

1

You can do it with the following:

export PS1="$PWD> " #this will always show the dir you were when performing the command
export PS1='$PWD> ' #this is the correct

Note that this will work for your current session. To make it persistent, add the line to your ~/.bashrc file.

For comprehensive information about this topic, you can check How to: Change / Setup bash custom prompt (PS1).

fedorqui
  • 275,237
  • 103
  • 548
  • 598
  • hey man..there seems to be a problem...it doesn't show the current working directory in the command line – ban Jul 08 '13 at 15:29
  • like it keeps showing /home/directory even when I am in a different directory – ban Jul 08 '13 at 15:30
  • Oh, I see. See my updated answer, it is just a matter of changing `"` for `'` so that it executes `$PWD` every time. – fedorqui Jul 08 '13 at 15:33