Ukwakha ama-aliases ku-GNU / Linux

Kunendlela elula yokwenza ngezifiso nokwenza eminye imiyalo ibe lula esivame ukuyisebenzisa "ikhonsoli", Ngokusebenzisa i- alias.

Un alias njengoba igama lalo lisho, kuzosisiza ukuthi esikhundleni segama noma uchungechunge lwamagama sifake elifushane nelilula. Masithathe isibonelo esisebenzisekayo, ake sithi sifuna ukubona i- izingodo kusuka ohlelweni, usebenzisa uhlelo lokusebenza olubizwa nge- Umbala wombala elibhekele ukufaka umbala kumphumela kukhonsoli. Ulayini uzoba:

$ sudo tailf -n 5 /var/log/syslog | ccze

Kepha ngiyaqiniseka ukuthi kuzoba lula uma esikhundleni sokubhala konke lokho, sifaka ikhonsoli ngokwesibonelo, into elula njengale:

$ syslog

Yiqiniso? Kungakhululeka kakhulu futhi kube lula ukukhumbula. Bese, sikwenza kanjani?

Ukwakha i-Alias.

Ukwakha i-alias kulula impela. I-syntax kungaba:

alias short_word = 'umyalo noma amagama ukufaka esikhundleni'

uma sithatha isibonelo esedlule kungaba:

alias syslog = 'Sudo tailf -n 5 / var / log / syslog | ccze '

Umyalo ufakwe kuzingcaphuno ezizodwa. Kepha umbuzo uwukuthi Sikubeka kuphi lokhu? Yebo, uma sifuna ukuthi kube ngesesikhashana nje, simane siyibhale kukhonsoli futhi sizohlala size siyivale.

Manje, uma siyifuna unomphela, sikufaka lokhu ngaphakathi kwefayela ~ / .bashrc okuku- / ekhaya, futhi uma kungenjalo, khona-ke siyayakha (njalo kunachashazi ngaphambili). Lapho sesingeze umugqa we alias Kuleli fayela, simane sifaka ikhonsoli:

$ . .bashrc

Futhi ngomumo !!!

Qaphela: Izolo ngenxa yezinkinga nge-ISP yethu asikwazanga ukushicilela noma yini ku- <° Linux, esixolisa ngayo


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-7, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   Jc kusho

    Lolu hlobo lokuthunyelwe alulimazi ukuvuselela lawo mathuluzi esingajwayele ukuwasebenzisa nsuku zonke. Futhi, ayinasikhathi; eminyakeni emithathu ngemuva kokuyibhala futhi ihlala njengosuku lokuqala.
    Ngeza lokho, okungenani ku-debian, kunconywa ukuthi usebenzise ifayili le-.bash_aliases ukufaka izibizo zakho esikhundleni sefayela olishoyo. Yena. .bashrc inakekela ukusesha kufayela le-alias engikushoyo.

  2.   UVictor kusho

    Siyabonga ngokufundisa. Nginombuzo: uthini umyalo '. .bashrc '? futhi ikakhulukazi wenzani ichashazi (.) eliphambi kwefayela .bashrc?

    1.    Isiguli kusho

      Ngiyazi ukuthi sekwephuze kakhulu, kepha ichashazi eliphambi kwegama lefayela lidala ukuthi lifihlwe kumafolda, ngakho-ke lizoba lapho, kepha ngeke ukwazi ukulibona uze ukhombise amafayela afihliwe.

      1.    alohl669 kusho

        Angicabangi ukuthi kubhekisa endaweni yokufihla amafayela. Uma ubheka kahle, kukhona enye ehlukaniswe isikhala ngaphambili:
        $. .bashrc

        Ekuqaleni bengicabanga ukuthi ngandlela thile lizosebenzisa ifayili noma lilayishe kabusha imininingwane eliqukethe. Esikhundleni salokho bekufanele ngiqale kabusha ukuze izibizo ziqale ukusebenza, ngakho-ke umyalo awaziwa.

  3.   johndry kusho

    Ungaqhubeka kanjani nokusebenzisa umyalo yize kukhona ama-alias abhekisa kulo myalo? (Isibonelo: ungawusebenzisa kanjani umyalo we-rm uma lokhu kungumbono wokunanela?)

  4.   Pablo kusho

    Ngibonga kakhulu ngalokhu. Halala!

  5.   umagazine kusho

    Sawubona, ngiyabonga kakhulu ngesifundo, sangisiza kakhulu.