亚洲高清vr播放在线观看,欧美亚洲精品免费,欧美日韩天堂在线视频,午夜福利小视频

      學習啦 > 學習電腦 > 操作系統(tǒng) > Linux教程 > Linux如何設置命令提示字符

      Linux如何設置命令提示字符

      時間: 曉斌668 分享

      Linux如何設置命令提示字符

        Linux中支持自定義command的prompt字符,但是有很多LINUX操作系統(tǒng)的新手并不知道如何使用,不過沒關系,學習啦小編在本文就給大家介紹下了如何設置命令提示字符。

        Linux如何設置命令提示字符

        使用echo $PS1命令查看prompt字符

        [root@golonglee ~]# echo $PS1

        [\u@\h \W]$

        [root@golonglee ~]#

        在/etc/inittab文件中可以是初始化列表

        這是vi /etc/bashrc文件的內(nèi)容

        # /etc/bashrc

        # System wide functions and aliases

        # Environment stuff goes in /etc/profile

        # It's NOT a good idea to change this file unless you know what you

        # are doing. It's much better to create a custom.sh shell script in

        # /etc/profile.d/ to make custom changes to your environment, as this

        # will prevent the need for merging in future updates.

        # are we an interactive shell?

        if [ "$PS1" ]; then

        if [ -z "$PROMPT_COMMAND" ]; then

        case $TERM in

        xterm*)

        if [ -e /etc/sysconfig/bash-prompt-xterm ]; then

        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm

        else

        PROMPT_COMMAND='printf "3]0;%s@%s:%s

      學習啦 > 學習電腦 > 操作系統(tǒng) > Linux教程 > Linux如何設置命令提示字符

      Linux如何設置命令提示字符

      時間: 曉斌668 分享

      Linux如何設置命令提示字符

        Linux中支持自定義command的prompt字符,但是有很多LINUX操作系統(tǒng)的新手并不知道如何使用,不過沒關系,學習啦小編在本文就給大家介紹下了如何設置命令提示字符。

        Linux如何設置命令提示字符

        使用echo $PS1命令查看prompt字符

        [root@golonglee ~]# echo $PS1

        [\u@\h \W]$

        [root@golonglee ~]#

        在/etc/inittab文件中可以是初始化列表

        這是vi /etc/bashrc文件的內(nèi)容

        # /etc/bashrc

        # System wide functions and aliases

        # Environment stuff goes in /etc/profile

        # It's NOT a good idea to change this file unless you know what you

        # are doing. It's much better to create a custom.sh shell script in

        # /etc/profile.d/ to make custom changes to your environment, as this

        # will prevent the need for merging in future updates.

        # are we an interactive shell?

        if [ "$PS1" ]; then

        if [ -z "$PROMPT_COMMAND" ]; then

        case $TERM in

        xterm*)

        if [ -e /etc/sysconfig/bash-prompt-xterm ]; then

        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm

        else

        PROMPT_COMMAND='printf "3]0;%s@%s:%s

      7" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

        fi

        ;;

        screen)

        if [ -e /etc/sysconfig/bash-prompt-screen ]; then

        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen

        else

        PROMPT_COMMAND='printf "3]0;%s@%s:%s3\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

        fi

        ;;

        *)

        [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default

        ;;

        esac

        fi

        # Turn on checkwinsize

        shopt -s checkwinsize

        [ "$PS1" = "\s-\v\$ " ] && PS1="[\u@\h \W]\$ "

        編輯etc目錄下的bashrc文件,可以修改提示符

      395380