How to avoid tilde ~ in Bash prompt? bash runs expansions in the prompt; just make sure to escape them. PS1='\h:$(pwd)\n$'