ºìÁªLinuxÃÅ»§
Linux°ïÖú

linuxÏÂÉèÖÃÃüÁîÌáʾ·û£¡£¡£¡

·¢²¼Ê±¼ä:2011-09-01 18:34:23À´Ô´:ºìÁª×÷Õß:ÎÒÀ´³ÙÁË
[i=s] ±¾Ìû×îºóÓÉ ÎÒÀ´³ÙÁË ÓÚ 2011-9-1 18:38 ±à¼­ [/i]

ǰЩÌì°²×°ÁËcentos6.0¡£×Ô¼ºÒ²³¢ÊÔ×ÅʹÓÃÃüÁîÐÐÀ´Ìá¸ß×Ô¼º£¬µ«ÊÇ£¬¿àÓÚÿ´Î¼üÈëµÄÃüÁÊÇÒ»¸öºÚºõºõµÄÑÕÉ«£¬¶øÇÒÇ°ÃæµÄʲôÉ豸Ãû³Æ°¡¡¢Ö÷»úÃû³Æ°¡¡¢ µ±Ç°Â·¾¶°¡Ê²Ã´µÄ£¬×Ô¼ºÓÃÆðÀ´¾ÍÊǸоõ²»Ë¬µÄºÜ£¡Õâ²»£¬ÏûÍ£²»ÏµÄÎÒ£¬ÔÚÕâÀïÑо¿ÁËÒ»·¬£º½²×Ô¼ºµÄÃüÁîÌáʾ·ûŪµÃ»¹ÂýƯÁÁµÎ£¡(ºÇºÇ£¬·´ÕýÎÒ¾õµÃƯÁÁ)¡£

ºÃÁË£¬ÏÈÀ´ËµËµÊ²Ã´ÊÇPS1£¬PS1ÊÇlinuxÀïÍ·µÄÒ»¸öĬÈϵĻ·¾³±äÁ¿£¬ÖÁÓÚÄãµÄϵͳµ±ÖÐÓÐÄÇЩ»·¾³±äÁ¿£¬Äã¿ÉһʹÓÃÃüÁî¡°env¡±À´²é¿´ [#4#caopeng@cp ~]$env£»ÆäʵÕâÀïPS1¾ÍÊÇÓÃÀ´ÉèÖÃÃüÁîÌáʾ·ûµÄ»·¾³±äÁ¿¡£
ÏÖÔÚÀ´¿´¿´PS1µ½µ×ÓÐÄÇЩÅäÖ㬵½µ×ÔõÑùÅäÖã¿
PS1ÓÐÄÇЩÅäÖ㬻òÕß˵PS1ÀïÍ·¶¼ÄÜÅäÖÃЩÃüÁîÌáʾ·ûµÄʲô¶«Î÷£º

[list=1]
[*]\d £º´ú±íÈÕÆÚ£¬¸ñʽΪweekday month date£¬ÀýÈ磺"Mon Aug 1"
[*] \H £ºÍêÕûµÄÖ÷»úÃû³Æ¡£ÀýÈ磺ÎҵĻúÆ÷Ãû³ÆΪ£ºfc4.linux£¬ÔòÕâ¸öÃû³Æ¾ÍÊÇfc4.linux
[*] \h £º½öÈ¡Ö÷»úµÄµÚÒ»¸öÃû×Ö£¬ÈçÉÏÀý£¬ÔòΪfc4£¬.linuxÔò±»Ê¡ÂÔ
[*] \t £ºÏÔʾʱ¼äΪ24Сʱ¸ñʽ£¬È磺HH£ºMM£ºSS
[*] \T £ºÏÔʾʱ¼äΪ12Сʱ¸ñʽ
[*] \A £ºÏÔʾʱ¼äΪ24Сʱ¸ñʽ£ºHH£ºMM
[*] \u £ºµ±Ç°Óû§µÄÕ˺ÅÃû³Æ
[*] \v £ºBASHµÄ°æ±¾ÐÅÏ¢
[*] \w £ºÍêÕûµÄ¹¤×÷Ŀ¼Ãû³Æ¡£¼ÒĿ¼»áÒÔ ~´úÌæ
[*] \W £ºÀûÓÃbasenameÈ¡µÃ¹¤×÷Ŀ¼Ãû³Æ£¬ËùÒÔÖ»»áÁгö×îºóÒ»¸öĿ¼
[*] \# £ºÏ´ïµÄµÚ¼¸¸öÃüÁî
[*] \$ £ºÌáʾ×Ö·û£¬Èç¹ûÊÇrootʱ£¬Ìáʾ·ûΪ£º# £¬ÆÕͨÓû§ÔòΪ£º$
[/list]


¿´Ã÷°×ÁËô£¿£¿ºÇºÇ£¬Æäʵ²»Ã÷°×Ò²Ã×ÓÐÈκιØϵ£¬Ö»ÒªÄãÓõÄʱºò£¬²é²é¾ÍºÃÁË¡£²»Êǵ½ÓÐÃ×Óз¢ÏÖÒ»¸öÎÊÌâ?Äã¸Õ²ÅµÄÃüÁî²»ÊÇ¿ÉÒÔÓи÷ÖÖÑÕɫô£¿ÔõôÕâÀïûÓУ¿ºÇºÇ£¬²»Òª×ż±£¬ÏÂÀ´¾Í˵˵Õâ¸öÑÕÉ«µÄÎÊÌâ¡£ÎÒÃÇ¿ÉÒÔͨ¹ýÉèÖÃPS1±äÁ¿Ê¹µÃÌáʾ·û±ä³É²ÊÉ«¡£ÔÚPS1ÖÐÉèÖÃ×Ö·ûÐòÁÐÑÕÉ«µÄ¸ñʽΪ£º\[\e[F;Bm\] ÆäÖС°F¡±Îª×ÖÌåÑÕÉ«£¬±àºÅ30~37£»¡°B¡±Îª±³¾°É«£¬±àºÅ40~47¡£ ²»¹ýÄØ£¬ÄÜÉèÖÃÑÕÉ«£¬Ëû¾Í¿Ï¶¨Äܹ»È¡ÏûÉèÖã¬×¢Ò⣺ÕâÀïµÄÈ¡ÏûÉèÖ㬺Ͳ»ÉèÖÃÊÇÁ½ÂðÊÂÇ飡ÖÁÓÚÏêϸÇø±ð£¬µ±Äã¶ÁÍêÁËÎҵIJ©ÎÄÄã¾ÍOÁË¡£ºÇºÇ¡£È¡ÏûÉèÖãº\[\e[m\]
ÑÕÉ«±í

[list=1]
[*]Ç°¾° ±³¾° ÑÕÉ«
[*]¡¡¡¡30 40 ºÚÉ«
[*]¡¡¡¡31 41 ºìÉ«
[*]¡¡¡¡32 42 ÂÌÉ«
[*]¡¡¡¡33 43 »ÆÉ«
[*]¡¡¡¡34 44 À¶É«
[*]¡¡¡¡35 45 ×ϺìÉ«
[*]¡¡¡¡36 46 ÇàÀ¶É«
[*]¡¡¡¡37 47 °×É«
[/list]

ûÓÐÈËɵºõºõµÄÉèÖÃΪ°×É«°É.....


[list=1]
[*]´úÂë ÒâÒå
[*]0 OFF
[*]1 ¸ßÁÁÏÔʾ
[*]4 underline
[*]7 ·´°×ÏÔʾ
[*]8 ²»¿É¼û
[/list]


ºÃÁË£¬ÏÖÔÚ½«PS1¶¼ÓÐÄÇЩÅäÖö¼ËµÃûÁË£¬ÏÖÔÚÀ´¿´¿´£¬Ó¦¸Ã¸ÃÔõôÅä¡£ÎҾͰ´ÕÕÎÒµÄÅäÖã¬À´ËµÃ÷Ï£¬ÆäËûµÄ¸úÎҵĶ¼Ò»Ñù¡£

[\[\e[32m\]#\##\[\e[31m\]\u@\[\e[36m\]\h \w]\$\[\e[m\]

ÕâÊÇÎÒµÄÅäÖÃ

ÏÖÔÚÀ´¿´\[\e[32m\]£¬×¢Ò⣺×îÇ°ÃæµÄÄǸö·½À¨ºÅ²»ÊÇÓÃÔÚÕâÀïµÄ¡£Õâ²»¾Í˵ÃûÁËÒªÉèÖÃΪÂÌɫô£¬À´¿´¿´ÎÒµÄÃüÁîÌáʾ·û£º [#4#caopeng@cp ~]$ ÓÐÂÌÉ«µÄ°É¡£
È»ºó#\##¾ÍÊÇÏÔʾÏÖÔÚÔËÐеÄÊǵڼ¸ÌõÃüÁîÁË£¬¿´µ½ÁË°É¡£ÎÒÕâÀïÊǵÚËÄÌõ¡£
ÏÂÀ´ÓÖÊÇÒ»¸öÉèÖÃÑÕÉ«µÄ[\e[31m\]£¬ÊÇÉèÖÃΪºìÉ«°É£¬Õâ²»Ò²Óкìɫô¡£ [#4#caopeng@cp ~]$¡£ºÇºÇ
ÏÂÀ´¾ÍÊÇ\u@ÕâÊÇÂïÒâ˼£¿×Ô¼º²î±í¿´È¥£¬È»ºó²»ÓÖÊÇÒ»¸öÉèÔÚÑÕÉ«µÄô£¨ÕâÀïÏÔʾµÄ²»ÔõôºÃ£©£¬
\h \w ÊÇʲôÒâ˼£¿\h ÊÇ˵£º½öÈ¡Ö÷»úµÄµÚÒ»¸öÃû×Ö£¬\wÊÇ˵£ºÏÔʾÍêÕûµÄ·¾¶£¬µ«ÊDz»Öªµ½ÎªÊ²Ã´¼ÒËûÏÔʾ¡«¶ø²»ÊǾø¶Ô·¾¶¡£
ÔÚÏÂÀ´²»ÊÇÒ»¸ö ] ô ¡£¿ªÍ·²»ÓÐÒ»¸ö [ ô¡£ÕâÁ½¸ö¸ÕºÃ´îÅäÔÚÒ»ÆðµÄ¡£
È»ºó×îµÄÕâ¸ö \[\e[m\] ʹÓÃÀ´¹Ø±ÕÑÕÉ«ÉèÖõġ£ÒªÊÇÄãûÓÐÕâ¸öµÄ»°£»ÄÇô£¬ÄãµÄÃüÁîÌáʾ·û£¬°üÀ¨Äãͨ¹ýÃüÁîÌáʾ·ûÊä³öµÄ¶«Î÷¶¼ÊǺÍ×îºóÒ»´ÎµÄÑÕÉ«ÉèÖÃÏàͬ(³ýÁËһЩÓÐÌØÊâÒâÒåµÄÎļþ )¡£


ºÙºÙ£ºÎÒ»¹ÁôÒ»ÊÖ£¬ÄãÖªµÀÕâ¸öÅäÖÃдµ½ÄÄÀïô£¿£¿£¿
Ó¦¸ÃÔÚÓû§µÄ¸ùĿ¼Ï嵀 ".bashrc" ×¢ÒâÇ°ÃæÓиö"." ±íʾÊÇÒþ²ØµÄ¡£
ÔÚÀïÍ·µÄ×îºóÒ»ÐмÓÉÏ£º
PS1='[\[\e[32m\]#\##\[\e[31m\]\u@\[\e[36m\]\h \w]\$\[\e[m\]'
È»ºó±£´æ¡£È»ºó source .bashrc »òÕß ". .bashrc" »òÕß×¢Ïúһϡ£
OK£¡µ½´ËΪֹÉèÖóɹ¦£¡Äã¿ÉÒ»¾¡ÇéµÄÏíÊÜÁË...

´ËÎÄÀ´×ÔÎÒµÄһƬ²©ÎÄ£ºhttp://blog.sina.com.cn/s/blog_6268defa0100wijx.html »¶Ó­·ÃÎÊ¡£
ÉùÃ÷£º×ªÔØÇëÖøÃû³ö´¦£¡£¡£¡£¡
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 52 ÌõÆÀÂÛ

  1. smxhuimin ÓÚ 2015-02-01 01:24:23·¢±í:

    Ö§³ÖÂ¥Ö÷

  2. jack110 ÓÚ 2014-12-13 21:46:56·¢±í:

    ºÃ£¬²»´í£¬ºÃ¶«Î÷

  3. abcdefg1999 ÓÚ 2013-07-18 13:52:15·¢±í:

    ѧϰ

  4. cswait ÓÚ 2013-06-12 22:00:09·¢±í:

    Ç¿ÎÄING£¬Ö§³ÖÂ¥Ö÷

  5. cswait ÓÚ 2013-06-12 21:59:35·¢±í:

    Ç¿ÎÄING£¬Ö§³ÖÂ¥Ö÷

  6. cswait ÓÚ 2013-06-12 21:59:20·¢±í:

    ¶¥Ò»Ï£¬Ð»Ð»·ÖÏí

  7. xuhh2012 ÓÚ 2013-05-02 16:25:15·¢±í:

    ѧϰÁË ²»´í ϲ»¶ Òª¶¥

  8. xuhh2012 ÓÚ 2013-05-02 16:24:56·¢±í:

    ѧϰÁË ²»´í ϲ»¶ Òª¶¥

  9. xuhh2012 ÓÚ 2013-05-02 16:23:57·¢±í:

    ²»´í ϲ»¶ Òª¶¥

  10. ÔÆÁú°Á¾ÅÏö ÓÚ 2013-05-02 14:34:57·¢±í:

    ÂýÂýѧϰÖС£Ð»Ð»Â¥Ö÷¡£

  11. study007 ÓÚ 2013-03-08 10:46:07·¢±í:

    ¶¥

  12. gky2009514 ÓÚ 2012-12-07 13:05:23·¢±í:

    ÐÂÊÖÍê³ÉÈÎÎñ£¬ÇóÏÂÊé¼®~

  13. jgx_tk ÓÚ 2012-05-10 14:27:12·¢±í:

    1# ÎÒÀ´³ÙÁË


    gasdgasga

  14. network_boy ÓÚ 2012-03-22 17:14:52·¢±í:

    Ö§³ÖÏÂ

  15. wh10409 ÓÚ 2012-03-20 15:26:02·¢±í:

    ²»´í²»´í

  16. oucjlz ÓÚ 2012-02-25 11:44:36·¢±í:

    q):-s

  17. ÎÞ²»Îª ÓÚ 2012-02-24 13:38:21·¢±í:

    ѧϰѧϰ¡£¡£¡£

  18. hdongmiao ÓÚ 2012-02-22 17:05:00·¢±í:

    ѧϰÏ£¬

  19. éÎÝÎÔÁú ÓÚ 2012-02-22 11:26:04·¢±í:

    ºÜºÃ

  20. éÎÝÎÔÁú ÓÚ 2012-02-22 11:26:00·¢±í:

    »¹ºÃ

  21. éÎÝÎÔÁú ÓÚ 2012-02-22 11:25:55·¢±í:

    àÅ

  22. éÎÝÎÔÁú ÓÚ 2012-02-22 10:43:50·¢±í:

    ѧϰ£¡

  23. pycxhjb ÓÚ 2012-02-03 16:54:50·¢±í:

    Ò»¿´¾ÍÖªµÀÂ¥Ö÷³ä·Ö·¢»ÓÁËLÓѵġ°ÕÛÌÚ¾«Éñ¡±£¬ÅÄש×ßÈËÁË

  24. antfire_linux ÓÚ 2012-01-24 20:51:33·¢±í:

    ¼ÌÐøŬÁ¦Ñ§Ï°ÖС£

  25. sanm ÓÚ 2012-01-18 10:28:23·¢±í:

    (e:e2s

  26. zhoutingting ÓÚ 2012-01-05 20:44:21·¢±í:

    Ö§³Öһϣ¡ºÙºÙ...

  27. ÎíÔÂOÇïË® ÓÚ 2012-01-03 17:08:14·¢±í:

    ¶¥ÏÂ:0w5ty(1

  28. lanlanlangzi ÓÚ 2011-11-01 22:00:07·¢±í:

    ºÃ¶«Î÷{:3_107:}

  29. tangrm ÓÚ 2011-11-01 17:46:40·¢±í:

    ²©ÎIJ»´íÁË

  30. ghost_bat ÓÚ 2011-09-20 17:50:17·¢±í:

    ÎÒ¸Õ¿ªÊ¼Ñ§ »¹²»ÔõôÁ˽⠲»¹ý»¹ÊǶ¥Ò»ÏÂ

  31. zhima ÓÚ 2011-09-16 10:16:14·¢±í:

    ²»´íµÄ Ìáʾ·½Ê½

  32. ÕÅÏ£Íû ÓÚ 2011-09-13 17:03:19·¢±í:

    ÎÒÓÀÔ¶Ö§³ÖÄã

  33. ÕÅÏ£Íû ÓÚ 2011-09-13 17:03:13·¢±í:

    ÎÒÓÀÔ¶Ö§³ÖÄã

  34. ÕÅÏ£Íû ÓÚ 2011-09-13 17:03:09·¢±í:

    ÎÒÓÀÔ¶Ö§³ÖÄã

  35. ÕÅÏ£Íû ÓÚ 2011-09-13 17:03:01·¢±í:

    ÎÒÓÀÔ¶Ö§³ÖÄã

  36. ÕÅÏ£Íû ÓÚ 2011-09-13 17:02:28·¢±í:

    Õæ²»´í

  37. ÕÅÏ£Íû ÓÚ 2011-09-13 17:02:24·¢±í:

    Õæ²»´í

  38. ÕÅÏ£Íû ÓÚ 2011-09-13 17:02:20·¢±í:

    Õæ²»´í

  39. ÕÅÏ£Íû ÓÚ 2011-09-13 17:02:17·¢±í:

    Õæ²»´í

  40. ÕÅÏ£Íû ÓÚ 2011-09-13 17:02:11·¢±í:

    Õæ²»´í