1

I am using Unix and I login in my account.

Then my command line looks like this:

[username@somestupidfolder]$

How can I hide this information so I can get clean $ as cursor.

Basically:

[username@somestupidfolder]$ to $

1
  • Note that it is conventional to leave a space after the $ in the prompt. Both the answers do that for you. Commented Jun 2, 2014 at 7:31

2 Answers 2

3

Run

PS1="$ "

from the terminal. If you want this to persist every time you launch a new terminal, you will need to add this change to your .bash_rc. PS1 should already be defined there (and giving you the present format you see).

Sign up to request clarification or add additional context in comments.

Comments

3

It depends from the shell you are using

for bash shell:
PS1="$ "
to make it stable for each new shell you will write it in .bash_rc or in .profile (or in .bash_profile).

for csh or tcsh
set prompt="$ "
to make it stable for each new shell you will write it in .cshrc or .tcshrc (if it is a tcsh shell)

for a zsh

PROMPT='$ '
to make it stable for each new shell you will write it in .zshrc

Bonus: If you are in bash and you want a minimalist prompt with a nice feature you can try

PS1="\`if [ \$? = 0 ]; then echo -e '\[\e[01;32m\]$'; else echo -e '\[\e[01;31m\]$'; fi\` \[\e[0m\]"

You will have a green $ if the last command was finished without error, or red otherwise.

2 Comments

I didn't know in which shell you work... there's a little bonus. Give it a check if it follows what you where searching for. :)
nice feature, but it gives me red if I close file with [CTRL]+[Z]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.