ºìÁª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. ÕÅÏ£Íû ÓÚ 2011-09-13 17:02:06·¢±í:

    Õæ²»´í

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

    Õæ²»´í

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

    ѧϰÁË£¬Ð»Ð»

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

    ѧϰÁË£¬Ð»Ð»

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

    ѧϰÁË£¬Ð»Ð»

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

    ѧϰÁË£¬Ð»Ð»

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

    Ö§³ÖÂ¥Ö÷

  8. michaelsohu ÓÚ 2011-09-02 19:43:21·¢±í:

    ѧϰÁË£¬Ð»Ð»

  9. Lzhc ÓÚ 2011-09-02 15:57:14·¢±í:

    Õæ²»´í

  10. GrowthÕ× ÓÚ 2011-09-02 09:45:26·¢±í:

    ¸ÐлÎÒÀ´³ÙÁ˵ķÖÏí£¬±¾Ìù¼ÓÈëµ½ÂÛ̳¶¥ÖõÄLinuxÓ¦ÓÃË÷ÒýÌùÖÐ

  11. Austria ÓÚ 2011-09-01 21:17:20·¢±í:

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

  12. ÎÒÀ´³ÙÁË ÓÚ 2011-09-01 18:38:22·¢±í:

    »¶Ó­ÅÄש£¡£¡£¡