How to make username in terminal smaller?

Romeo

When you opens a terminal it displays the username and the machine name. As an example mine shows: romeo@romeo-Satellite-C660D:~$. It's really annoying because it's kinda big. Can i make this smaller, like, only show romeo?

I know it sounds stupid, but I'm new with Unix based OSes.

Andrejs Cainikovs

You need to alter PS1 variable in your environment. PS1 is responsible of how fancy your command prompt will look alike, and what information it will contain.

Permanent change

Following is the excerpt of default .bashrc file in Ubuntu 10.04 LTS:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

This makes command prompt look like this: username@hostname:~/directory$

이것을 변경하고 @\h에서 부분을 삭제 PS1하면 명령 프롬프트에서 호스트 이름 부분이 제거됩니다.

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u:\w\$ '
fi

결과: username:~/directory$

임시 변경

PS1현재 bash세션 에서 재정의 :

export PS1="\u:\w\$ "

자원:

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How can i make this css star smaller?

분류에서Dev

How to make the Terminal make a noise on command completion?

분류에서Dev

how can i make a username and password test method that doesnt overlap?

분류에서Dev

How can I make it so I click on one smaller image so it changes the larger version of the image?

분류에서Dev

How to make the top bar of my terminal say what command is running?

분류에서Dev

How to make a self-made bash_profile recognized by the terminal?

분류에서Dev

How do I make a requesocks request with socks5 username and password?

분류에서Dev

How to Break Array into Smaller Arrays?

분류에서Dev

How do i make my jar file execute like a regular application from Terminal

분류에서Dev

How can I make readline add pre-"typed" text on terminal startup?

분류에서Dev

How can I make a script that opens terminal windows and executes commands in them?

분류에서Dev

how to run make a terminal program run automatically at reboot with preset input variables

분류에서Dev

How to fit a big picture in a smaller space

분류에서Dev

How to add a number at end of username

분류에서Dev

Socket.io - How to prompt for username, and save the username in an array?

분류에서Dev

How to disable respawn for terminal?

분류에서Dev

How to play snake in terminal?

분류에서Dev

How to set a proxy for terminal?

분류에서Dev

How to really clear the terminal?

분류에서Dev

How to rename folders in terminal?

분류에서Dev

How to delete a single cached username from Chrome?

분류에서Dev

How to grab username from the PHP Login Project

분류에서Dev

How to create username unique with respect to database?

분류에서Dev

PostgreSQL - how to drop a user with hyphen in his username

분류에서Dev

How to add /home/username/bin to $PATH?

분류에서Dev

how can i know username of clients

분류에서Dev

How to easily break up a text file into pieces smaller than a threshold?

분류에서Dev

How can I clone an entire drive (or partition) to a smaller drive (or partition)?

분류에서Dev

How to lock a folder from terminal

Related 관련 기사

  1. 1

    How can i make this css star smaller?

  2. 2

    How to make the Terminal make a noise on command completion?

  3. 3

    how can i make a username and password test method that doesnt overlap?

  4. 4

    How can I make it so I click on one smaller image so it changes the larger version of the image?

  5. 5

    How to make the top bar of my terminal say what command is running?

  6. 6

    How to make a self-made bash_profile recognized by the terminal?

  7. 7

    How do I make a requesocks request with socks5 username and password?

  8. 8

    How to Break Array into Smaller Arrays?

  9. 9

    How do i make my jar file execute like a regular application from Terminal

  10. 10

    How can I make readline add pre-"typed" text on terminal startup?

  11. 11

    How can I make a script that opens terminal windows and executes commands in them?

  12. 12

    how to run make a terminal program run automatically at reboot with preset input variables

  13. 13

    How to fit a big picture in a smaller space

  14. 14

    How to add a number at end of username

  15. 15

    Socket.io - How to prompt for username, and save the username in an array?

  16. 16

    How to disable respawn for terminal?

  17. 17

    How to play snake in terminal?

  18. 18

    How to set a proxy for terminal?

  19. 19

    How to really clear the terminal?

  20. 20

    How to rename folders in terminal?

  21. 21

    How to delete a single cached username from Chrome?

  22. 22

    How to grab username from the PHP Login Project

  23. 23

    How to create username unique with respect to database?

  24. 24

    PostgreSQL - how to drop a user with hyphen in his username

  25. 25

    How to add /home/username/bin to $PATH?

  26. 26

    how can i know username of clients

  27. 27

    How to easily break up a text file into pieces smaller than a threshold?

  28. 28

    How can I clone an entire drive (or partition) to a smaller drive (or partition)?

  29. 29

    How to lock a folder from terminal

뜨겁다태그

보관