Me te Terminal: Te whakapai ake i te ahua o te papatohu

Ko ahau tetahi o te hunga e hiahia ana ki te whakamahi i te teihana whakamutunga. Whakaaro ahau nga kaiwhakamahi katoa o GNU / Linux i tetahi waa kaore e taea e raatau te noho ki te kore, na te mea ko taua matapihi kua ki tonu i nga reta ka maama ake te ora, nene?

Engari ka taea e tatou kia ahua ataahua atu i te taunoa. Ko tetahi tauira o tenei ka kitea (ka tangohia) mai i ahua-ahua. Ko nga tohutohu ka whakaaturia e ahau ki a koe i muri, ko te waiho i to taatau taatai ​​me nga ahuatanga e whai ake nei:

Ka kite koe, te whakahau ki te mahi ka whakatakotohia ki waenga i ia ota he wātaka me te wa punaha.

Me pehea taku mahi?

Ka whakatuwherahia e maatau he etita kuputuhi (tauira Gedit) a ka maka e matou ki roto:

# 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

Ka mau tonu ki roto / home me te ingoa .bash_ps2 hei tauira. Na ka whakatuwherahia e maatau ta maatau .bashrc a ka taapiri atu matou:

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

Ka whakatuwherahia e maatau he tauranga ka kite i nga whakarereketanga 😀

 

Kite i: Tangata.


Ko nga korero o te tuhinga e piri ana ki o maatau kaupapa o matatika whakatika. Ki te ripoata i tetahi paatene paato Here.

17 korero, waiho maau

Waiho to korero

Ka kore e whakaputaina tō wāhitau īmēra. Kua tohua ngā āpure e hiahiatia ana ki *

*

*

  1. He kawenga mo nga raraunga: Miguel Ángel Gatón
  2. Te kaupapa o te raraunga: Whakahaerehia te SPAM, te whakahaere korero.
  3. Ture: To whakaae
  4. Whakawhitinga korero: Kaore nga korero e tukuna ki nga taha tuatoru engari ma te ture herenga.
  5. Rokiroki raraunga: Paetukutuku e whakahaerehia ana e Occentus Networks (EU)
  6. Tika: I nga wa katoa ka taea e koe te whakaiti, te whakaora me te muku i o korero.

  1.   Ngakau ka mea

    Mauruuru mo te tuhinga tuatahi o te tuhinga me te paatai, kei te kaha pea koe ki te whakarite xterm me te lxterminal i tua atu i te tae o te tuhinga me te papamuri? (Koinei nga waahanga e kaha ana taku whakamahi).
    Ka rawe!

  2.   Eduardo ka mea

    GENIALLLLLLLLLLLLLLLLL 🙂

    I whakamatauria e au i te wiki kua hipa i taku korerotanga i tenei kaupapa ki tetahi atu panui, engari na te mea he raru kei runga i nga kii ka honoa ki te .bashrc Kaore i taea e au te whakamahi. Na, i pai te mahi maaku i te tuatahi.

    Mauruuru.

    1.    KZKG ^ Gaara ka mea

      He koa ki te mohio he pai taau e hiahia ana 😉
      Mauruuru!

  3.   Tarekona ka mea

    :] tino pai mena ka mahi i taku whakaaro ka whakaarohia e au ... weeee, ka whakauruhia e au i enei rangi whakataa 😀

    1.    KZKG ^ Gaara ka mea

      Ina hoki i whakapai ake ahau i a koe hehe ... Ka nui atu nga paraoa i whakanohoia e au ka ahua pai ake, ka mahi ahau i tetahi pou e whakaputa ana i aku whakapainga me aku whakarereketanga 😉

      Whakatikahia: Engari ki te tuku i tena ki roto .bash_ps2 hoatu tenei tetahi: http://paste.desdelinux.net/paste/6

      1.    Eduardo ka mea

        He he taku ki nga raina 13 me te 34.

        1.    elav <° Linux ka mea

          Kua 2 kē mātou

      2.    itoito ka mea

        Fuck, tetahi atu programmer taha pouri ...

        1.    KZKG ^ Gaara ka mea

          Ka waiho e au te waehere ki konei, kaore au e mohio he aha te take i he ai te kupu ki a ratou ... o_0U he pai ki ahau:
          # 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 ka mea

    He tino pai tenei, i whakamatauria noa e au ka mahi 100% ubuntu 11.10

    Tena koe !!

  5.   pahuatia ka mea

    Ana, ka he ano ahau i nga raina 13 me te 34

    raina 13: EOF ohorere i te wa e rapu ana koe mo tetahi taurite "
    raina 34: hapa syntactic: ko te mutunga o te konae kaore i tumanakohia

    Ka whakamahia e au te linux mint 11 lxde mo te mea e tika ana.

    Mauruuru!

  6.   Jimselfking ka mea

    He 100% te mahi ma te kaiwhakamahi noa, engari i te wa ka nui atu to kaiutu ka mutu tana mahi, kaore he mahi. Ki taku whakaaro he ngawari noa iho, engari kaore au e mohio ki te mahi nui, tetahi otinga?

    1.    KZKG ^ Gaara ka mea

      He aha te mea ka waiho e koe ki roto i a koe .bashrc, me whakauru ano e koe ki roto /root/.bashrc
      Whakamatautau ka korero mai ki a maatau kei te pehea koe 🙂

      Kia ora 😀

      1.    Jimselfking ka mea

        He pai te mahi, kaore au i te mohio kaore i whakamatauria e au i mua i taku paatai. Mauruuru

        1.    KZKG ^ Gaara <° Linux ka mea

          Nah kaua e awangawanga 🙂

  7.   anahera ka mea

    E hoa, ki te awhina i ahau, tena koa, ka whakamatauria e au engari kaore i puta te porowhita a he mangu tonu, ka whakamahi ahau i te Fedora19, ka puta te waa ... ahakoa ra, he mihi nui ki to koha

  8.   Miguel ka mea

    he rite tonu te mahi o te debian ???