LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Gnome Terminal: Show only current directory at prompt? (https://www.linuxquestions.org/questions/linux-software-2/gnome-terminal-show-only-current-directory-at-prompt-469772/)

extrasolar 08-01-2006 11:17 AM

Gnome Terminal: Show only current directory at prompt?
 
In gnome terminal how do I prevent a long list of directories being displayed at the prompt and have only the current directory showing?

i.e. user@hostname:/dir3$

instead of user@hostname:/dir1/dir2/dir3$

ciotog 08-01-2006 11:28 AM

You need to set the PS1 environment variable to your liking. It's likely being set in .bashrc, maybe read /usr/doc/Linux-HOWTOs/Bash-Prompt-HOWTO (I think that's where it is in Fedora) for instructions.

Vgui 08-01-2006 12:20 PM

A quick search turned up:
http://www.comptechdoc.org/os/linux/tips/tipsps1.html
And from reading it looks like \W is what you need.
Add (or edit) the PS1 entry in ~/.bashrc to be similar to:
Code:

export PS1='\u@\h:\W$ '
That should get you going in the right direction.

extrasolar 08-01-2006 12:23 PM

Cheers. I did do a search on google and I found what I was after. Been experimenting with it.

jeelliso 08-01-2006 12:39 PM

Quote:

Originally Posted by extrasolar
Cheers. I did do a search on google and I found what I was after. Been experimenting with it.

If your results are different from what ciotog found, then please post them so everyone else can see.

extrasolar 08-01-2006 01:11 PM

http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html

Tons of info on Bash prompt.


All times are GMT -5. The time now is 10:50 PM.