0

Via Putty, i log onto a SuSe linux machine.

Suddenly, a percentage value appeared behind the commandline. Looks like that:

[<DOMAIN>\<USER>@<HOST>:/home] 544%

It seems the value is the current index of the command in history. How can i remove that? How have i have activated that?

Edit:

PS1='[\u@\h:\w] \!% '

By removing \! in $HOME/.profile PS1 it can be switched off. It seems I copied it by accident from an tutorial when changing environment variables.

  • could you post the output from echo "$PS1" ? – Jeff Schaller Aug 29 '18 at 14:28
  • Look through the files that Tim notes below, and remove the \! text from the PS1 variable assignment. – Jeff Schaller Aug 29 '18 at 14:46
0

You want to modify your prompt. In Bash, which is the default shell for most Linux distributions, it can be set for Interactive Logins in /etc/profile, $HOME/.bashrc, $OHME/.bash_profile, $HOME/.bash_login, or $HOME/.profile. That's the order those files are loaded, so a definition in $HOME/.profile will override any earlier definitions.

So, if you wanted to keep mostly the same format, just without the history index, you could add to your $HOME/.profile, something like (assuming the DOMAIN is being added to your environment as $domain via SSSD:

PS1='[$domain\\\u@\h:\w]% `
export PS1

That would give you a prompt that would look like:

[<DOMAIN>\<USER>@<HOST>:~]% 

For more info on setting your prompt read this tutorial.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.