-1

I am trying to change my current username on Linux Mint that shows up when I open a terminal window.

Currently:

john@myLinux

I want to change to:

gary@myLinux

I have tried:

(1) Start -> Settings -> Account Detail and altered the 'name' field.

(2) The steps mentioned here: https://askubuntu.com/questions/34074/how-do-i-change-my-username

(3) Altering the passwd file: https://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/

Option #3 seems to affect the username displaying in the terminal window but causes issues with logging in(my password becomes incorrect).

How can I successfully change the username that is displayed in my terminal window on Linux Mint OS?

Raoul Duke
  • 131
  • 7
  • 24
  • 2
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww May 19 '18 at 21:59

1 Answers1

3

This assumes you are using bash, and might not work for a different shell.

This will only change the terminal prompt text, it will not update your user account or change any other system files.

  1. in a terminal type DEFAULT=$PS1
  2. next type PS1='gary@\h\$ '
  3. last of all, if you want to return to your default prompt type PS1=$DEFAULT

Note 1: Make sure to save these settings in your .bashrc file under the home directory to have changes persist across terminal sessions.

Note 2: In step 2, \h tells the bash prompt to print out the computer hostname, the \$ prints out show the (#) symbol if you're ROOT otherwise show the ($) symbol.

More information can be found here: https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/

Gabriel Duarte
  • 974
  • 1
  • 13
  • 28
vicente louvet III
  • 384
  • 1
  • 2
  • 10