Nrog Rau Cov Dav Dav: Txhim kho cov tsos ntawm lub console

Kuv yog ib tus uas nyiam siv lub davhlau ya nyob twg. Kuv xav tias txhua tus neeg siv ntawm GNU / Linux Hauv ib kis lawv tsis tuaj yeem nyob tsis muaj nws, vim tias lub npov puv ntawm cov ntawv ua rau lub neej yooj yim dua rau peb, puas yog?

Tab sis peb tuaj yeem ua rau nws zoo nkauj prettier dua li lub neej ntawd. Ib qho piv txwv ntawm qhov no tuaj yeem pom (thiab rub) los ntawm gnome-saibCov. Cov lus qhia uas kuv yuav qhia koj hauv qab no yog tawm ntawm peb qhov xaus nrog qhov tsos hauv qab no:

Raws li koj tau pom, tus kev hais kom ua thiab muab tso rau ntawm ib qho kev txiav txim ncua sij hawm nrog lub kaw lus lub sijhawm.

Kuv yuav ua nws li cas?

Peb qhib phau ntawv kho (piv txwv li Gedit) thiab peb muab nws tso rau hauv:

# Fill with minuses
# (this is recalculated every time the prompt is shown in function prompt_command):

fill="--- "
reset_style='\[\033[00m\]'
status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color
prompt_style=$reset_style
command_style=$reset_style'\[\033[1;29m\]' # bold black
# Prompt variable:
PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\u@\h:\w\$'"$command_style "
# Reset color for command output
# (this one is invoked every time before a command is executed):
trap 'echo -ne "\e[0m"' DEBUG
function prompt_command {
# create a $fill of all screen width minus the time string and a space:
let fillsize=${COLUMNS}-9
fill=""
while [ "$fillsize" -gt "0" ] do
fill="-${fill}" # fill with underscores to work on
let fillsize=${fillsize}-1
done
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
bname=`basename "${PWD/$HOME/~}"`
echo -ne "\033]0;${bname}: ${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
;;
*)
;;
esac
}
PROMPT_COMMAND=prompt_command

Peb muab khaws cia rau hauv peb / tsev nrog rau lub npe .bash_ps2 muab ua piv txwv. Tom qab ntawd peb qhib peb .bashrc thiab peb ntxiv:

if [ -f "$HOME/.bash_ps2" ]; then
. "$HOME/.bash_ps2"
fi

Peb qhib lub davhlau ya nyob twg thiab peb tuaj yeem pom qhov hloov pauv 😀

 

Pom hauv: Neej neeg.


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

17 lus, tawm koj li

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm. Yuav tsum tau teb cov cim nrog *

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

  1.   Luweeds said

    Ua tsaug rau qhov blog ua ntej ntawm txhua yam thiab muaj lus nug, puas muaj lwm txoj hauv kev los kho cov xterm lossis lxterminal dhau ntawm cov xim ntawm cov ntawv thiab cov keeb kwm yav dhau?
    Ua tsaug rau koj!

  2.   Eduardo said

    GENIALLLLLLLLLLLLL 🙂

    Kuv tau sim nws ib lub lim tiam dhau los thaum kuv nyeem cov ncauj lus no hauv lwm qhov blog, tab sis vim yog muaj teeb meem nrog cov lus hauv qhov uas yuav tsum tau ntxiv rau .bashrc Kuv tsis tuaj yeem siv nws. Tam sim no nws ua haujlwm raug rau kuv ua ntej.

    Ua tsaug rau koj.

    1.    KZKG ^ Gaara said

      Lub siab xav paub tias nws tau ua raws li qhov koj xav tau
      regards

  3.   Lub tsho said

    :] zoo heev yog tias nws ua qhov kuv xav tias kuv xav txog ... quaj, Kuv nruab nws no lis xaus

    1.    KZKG ^ Gaara said

      Qhov tseeb kuv txhim kho nws hehe ... Kuv muab ntau lub ntsej muag zoo nkauj thiab nws zoo dua, Kuv yuav ua ib qho kev tshaj tawm kuv kev txhim kho thiab hloov kho 😉

      Edited: Hloov chaw tso hauv .bash_ps2 tso no lwm: http://paste.desdelinux.net/paste/6

      1.    Eduardo said

        Kuv tau txais ib qho yuam kev ntawm kab 13 thiab 34.

        1.    elav <° Linux said

          Peb twb yog 2 😀

      2.    Siab tawv said

        Fuck, lwm qhov sab tsaus nti programmer ...

        1.    KZKG ^ Gaara said

          Kuv tawm hauv txoj cai ntawm no, Kuv tsis paub vim li cas nws muab lawv yuam kev ... o_0U ua haujlwm zoo rau kuv:
          # Fill with minuses
          # (this is recalculated every time the prompt is shown in function prompt_command):

          fill="--- "
          reset_style='\[\033[00m\]'
          status_style=$reset_style'\[\033[0;90m\]' # gray color; use 0;37m for lighter color
          prompt_style=$reset_style
          command_style=$reset_style'\[\033[1;29m\]' # bold black
          # Prompt variable:
          PS1="$status_style"'$fill \t\n'"$prompt_style"'${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m$
          # Reset color for command output
          # (this one is invoked every time before a command is executed):
          trap 'echo -ne "\e[0m"' DEBUG
          function prompt_command {
          # create a $fill of all screen width minus the time string and a space:
          let fillsize=${COLUMNS}-9
          fill=""
          while [ "$fillsize" -gt "0" ]
          do
          fill="-${fill}" # fill with underscores to work on
          let fillsize=${fillsize}-1
          done
          # If this is an xterm set the title to user@host:dir
          case "$TERM" in
          xterm*|rxvt*)
          bname=`basename "${PWD/$HOME/~}"`
          echo -ne "\033]0;${bname}: ${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"
          ;;
          *)
          ;;
          esac
          }
          PROMPT_COMMAND=prompt_command

  4.   newbie said

    Zoo nkauj heev qhov no, Kuv tsuas yog sim nws thiab nws ua haujlwm 100% ubuntu 11.10

    Kwv txiaj !!

  5.   nyiag said

    Zoo, Kuv tseem tau txais ib qho yuam kev ntawm kab 13 thiab 34

    kab 13: Npaj txhij txog EOF thaum uas tab tom nrhiav kom raug phim ``
    kab 34: syntactic yuam kev: qhov kawg ntawm cov ntaub ntawv tsis tau txais

    Kuv siv linux mint 11 lxde rau yam uas nws muaj nqis.

    Ua tsaug!

  6.   Jim ເອງking said

    Nws ua haujlwm 100% nrog cov neeg siv ib txwm, tab sis lub sijhawm koj dhau los ua superuser nws tsis ua haujlwm, nws tsis ua dab tsi. Kuv twv tau yooj yim, tab sis kuv tsis paub yuav ua li cas ntau npaum li cas, txhua txoj kev daws teeb meem?

    1.    KZKG ^ Gaara said

      Dab tsi koj tso rau hauv koj li .bashrc, koj kuj yuav tsum tso nws /root/.bashrc
      Xeem ntawv thiab qhia rau peb seb koj yuav zoo li cas

      Txais tos 😀

      1.    Jim ເອງking said

        Nws ua haujlwm zoo kawg nkaus, Kuv tsis paub yuav ua li cas kuv tsis sim ua ntej thov. Ua tsaug rau koj

        1.    KZKG ^ Gaara <° Linux said

          Tsis txhob txhawj 🙂

  7.   Angel said

    Hav phooj ywg, yog tias koj yuav pab kuv thov kuv sim nws tab sis lub voj voog tsis tshwm sim thiab nws tseem nyob hauv cov xim dub, Kuv siv fedora19, sijhawm yog tias nws tshwm sim ... tseem ua tsaug ntau ntau rau koj txoj kev koom tes 🙂

  8.   Miguel said

    qhov no puas ua haujlwm tib yam hauv Debian ???