国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 電腦安全 > 系統(tǒng)安全 > Linux中如何設(shè)置命令提示字符

    Linux中如何設(shè)置命令提示字符

    時(shí)間: 黎正888 分享

    Linux中如何設(shè)置命令提示字符

      Linux中支持自定義command的prompt字符,下面就讓學(xué)習(xí)啦小編教大家Linux中如何設(shè)置命令提示字符吧。

      Linux中設(shè)置命令提示字符的方法

      使用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

    學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 電腦安全 > 系統(tǒng)安全 > Linux中如何設(shè)置命令提示字符

    Linux中如何設(shè)置命令提示字符

    時(shí)間: 黎正888 分享

    Linux中如何設(shè)置命令提示字符

      Linux中支持自定義command的prompt字符,下面就讓學(xué)習(xí)啦小編教大家Linux中如何設(shè)置命令提示字符吧。

      Linux中設(shè)置命令提示字符的方法

      使用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文件,可以修改提示符


    Linux中如何設(shè)置命令提示字符相關(guān)文章:

    1.Linux如何設(shè)置命令提示字符

    2.如何在windows系統(tǒng)中使用linux的命令

    3.Linux怎么更改命令提示符信息

    4.win7系統(tǒng)如何以管理員身份打開命令字符

    5.Linux下如何使用sed命令替換字符串

    2114111