Currently my prompt is:
xiaobai@dnxb:/tmp$
root@dnxb:/tmp#
My desired prompt:
xb@dnxb:/tmp$
rt@dnxb:/tmp#
My idea is alias of username, so i tried reuse the same uid to create a new user:
xiaobai@dnxb:~$ sudo useradd -ou 1000 -g1000 -d /home/xiaobai -s /bin/bash xb
xiaobai@dnxb:~$ su
Password:
root@dnxb:/home/xiaobai# passwd xb
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@dnxb:/home/xiaobai# exit
xiaobai@dnxb:~$ su xb
Password:
xiaobai@dnxb:~$ pwd
/home/xiaobai
xiaobai@dnxb:~$ PS1='\u:\W\$ '
xiaobai:~$ exit
xiaobai@dnxb:~$ id
uid=1000(xiaobai) gid=1000(xiaobai) groups=1000(xiaobai),27(sudo)
xiaobai@dnxb:~$
It doesn't change to xb for PS1 '\u'. If so, how ?