내가 사용하는 bash prompt

bash prompt 를 어떻게 꾸미느냐는 사람 취향에 따라 다르겠지만, 나는 아래와 같이 사용한다.
PS1="\n\[\e[30;1m\](\`if [ \$? = 0 ]; then echo \[\e[32m\]^_^\[\e[0m\]; else echo \[\e[31m\]O_O\[\e[0m\]; fi\`\[\e[30;1m\])-(\[\e[37;1m\]\u@\h\[\e[30;1m\])-(\[\e[37;1m\]jobs:\j\[\e[30;1m\])-(\[\e[37;1m\]cpus:\`ps u | grep `whoami` | awk '{ SUM += \$3 } END {print SUM}'\`%\[\e[30;1m\])-(\[\e[33;1m\]\w\[\e[30;1m\])\n(\[\[\e[37;1m\]! \!\[\e[30;1m\])-> \[\e[0m\]"

이하는 스크린샷:

사용자 삽입 이미지
2개의 라인에 걸쳐 이전 커맨드의 성공 여부, 자신의 whoami 및 hostname, job 개수, cpu 점유율, 그리고 현재 디렉토리를 차례로 표시하기 때문에 보다 편하게 사용할 수 있다. 짧은 프롬프트를 원하는 분들에게는 비추.

다른 괜찮은 bash prompt 를 참조하려면 아래 사이트를 방문하면 된다:

http://maketecheasier.com/8-useful-and-interesting-bash-prompts/2009/09/04


크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by Sunghwan

2011/07/14 05:34 2011/07/14 05:34
Response
No Trackback , No Comment
RSS :
http://sunghwanyoo.com/tc/rss/response/123

Trackback URL : http://sunghwanyoo.com/tc/trackback/123

« Previous : 1 : 2 : 3 : 4 : 5 : 6 : 7 : ... 105 : Next »

블로그 이미지

E-mail : shyoo at sunghwanyoo dot com

- Sunghwan

Notices

Archives

Authors

  1. Sunghwan

Calendar

«   2012/02   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      

Site Stats

Total hits:
221054
Today:
82
Yesterday:
95