Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using ubuntu 10.10 and now I got in the shell something like that:

machine1user@mylinux:~:

how can i change it to

machine1user@mylinux:/my/current/path :~: ?
share|improve this question
add comment

migrated from stackoverflow.com May 8 '11 at 11:03

This question came from our site for professional and enthusiast programmers.

2 Answers

the '~' at the end IS your current path. :)

share|improve this answer
    
The ~ refers to your home directory. If you run pwd, you would see something like /home/user (run echo $HOME to see the path to your home directory) –  Lekensteyn May 8 '11 at 13:00
add comment

Open ~/.bashrc in your text editor. Search for this:

    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"

and change it to this:

    PS1='${debian_chroot:+($debian_chroot)}\u@\h:$PWD\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: $PWD\a\]$PS1"

Specifically, you're replacing \w with $PWD. The first reference sets the text for your command prompt; the second sets the title which is usually shown in the menu bar of your terminal.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.