Bashrc, gyara saurin Bash zuwa ga yadda kuke so ta hanya mai sauki

game da bashrc

A makala ta gaba zamuyi dubi ne kan yadda ake gyara bashrc. Da wannan ne zamu cimma nasara ɓoye ko gyaggyara sunan mai amfani da mai karɓar sanarwa by Mazaje Ne Wasu mutane suna damuwa da sirri da tsaro. Ba sa taɓa bayyana wani abu game da shaidarka a kan layi. Idan kana daya daga cikinsu, zaka so wannan dan bayanin dan kare sirrinka kadan.

Idan kai mai rubutun ra'ayin yanar gizo ne ko marubuta na fasaha, tabbas za ka buƙaci loda hotunan kariyar Gnu / Linux na gidan yanar gizan ka da shafukan yanar gizan ka wasu lokuta. Kuma kamar yadda duk masu amfani da Gnu / Linux suka sani, tashar zata bayyana sunan mai amfani da kuma mai masaukin mu.

Idan kana ɗaya daga cikin waɗanda ke yin koyawa da raba hotunan kariyar tashar ka kuma kai ma ka damu da sirri da tsaro, mafi amfani shine kawai ƙirƙirar wani asusun mai amfani azaman admin @ demo ko mai amfani @ misali. Za mu iya amfani da waɗannan asusun don yin jagorori ko bidiyo da loda su zuwa shafinmu ko hanyoyin sadarwarmu ba tare da damuwa da bayanan da tashar ta nuna ba. Amma akwai wasu zaɓuɓɓuka kamar yadda za mu gani a ƙasa.

Sunan mai amfani / mai masaukin na iya zama mai sanyi sosai saboda haka watakila ba kwa son wasu su kwafa shi kuma suyi amfani da shi azaman nasu. A gefe guda, sunan mai amfani / sunan mai masaukin na iya zama baƙon abu, mara kyau, ko kuma yana iya ƙunsar haruffa masu ɓaci, don haka ƙila ba ku da sha'awar wasu su gan su. A irin waɗannan yanayi, wannan ɗan ƙaramin taimako na iya taimaka maka ɓoye ko canza sunan mai amfani @ localhost a cikin tashar.

bashirc wanda ba a gyara ba

A cikin hoton da ya gabata zaku iya ganin hakan a cikin tashar tawa sunan mai amfani "sapoclay" kuma "entreunosyceros ”shine mai masaukina.

Oye "sunan mai amfani @ localhost:" ta amfani da fayil ɗin bashrc

Da farko, zamu shirya namu fayil "~ / .bashrc". Zan yi amfani da Editan Vim don wannan, amma cewa kowane ɗayan yana amfani da wanda suka fi so. A halin da nake ciki, bayan buɗe tashar (Ctrl + Alt + T) zan rubuta umarnin mai zuwa:

vi ~/.bashrc

Da zarar mun buɗe, za mu danna maballin 'Esc' da 'i'. Sau ɗaya a cikin yanayin sakawa zamu kara wadannan zuwa karshen fayil din:

bashrc tare da alama

PS1="\W> "

Don fita fayil ɗin, kamar yadda koyaushe a cikin vim, dole ne mu danna 'mabuɗinEsc' sai me rubuta: wq domin adanawa da rufe fayil.

Bayan mun dawo cikin na'ura mai kwakwalwa, dole ne muyi gudanar da wannan umarni don yin canje-canje masu tasiri:

source ~/.bashrc

na'ura wasan bidiyo tare da alama

Za mu ga canje-canje nan da nan. Yanzu ba za mu ƙara ganin mai amfani ba @ localhost part. Alamar ~> kawai za a gani.

Gyara "sunan mai amfani @ localhost:" ta amfani da fayil din bashrc

Idan abin da kuke nema ba shine ɓoye ɓangaren mai amfani ba @ localhost, amma idan kuna nema canza bash da sauri zuwa wani abu mai ban sha'awa da ma'ana dole ne mu koma zuwa shirya ~ / .bashrc fayil. Daga m (Ctrl + Alt + T), kamar yadda yake a misalin da ya gabata, za mu rubuta:

vi ~/.bashrc

- Buɗe fayil ɗin kuma kunna yanayin sakawa, za mu kara layi mai zuwa a karshen na daya:

bashrc tare da rubutu

PS1="entreunosyceros> "

Sauya «kamara»Tare da duk wani haɗin haruffa da kake so. Lokacin da kake dashi, latsa maɓallinEsc'kuma ya rubuta : wq don ajiyewa da fita fayil.

para duba canje-canje da aka yiKamar yadda yake a misalin da ya gabata, za a zartar da umarnin mai zuwa don sabunta canje-canje:

source ~/.bashrc

na'ura wasan bidiyo tare da rubutu

Wadannan canje-canjen zasu bayyana nan take. Muna iya ganin haruffa entreunosyceros a cikin kwasfa da sauri.

Samo saituna don bashrc ta yanar gizo

Idan kanaso ka iya saita saurin kwamfutarka ta hanyarka, zaka iya zuwa gidan yanar gizon bashrarwa. A ciki zaku iya zaɓar ta 'ja da sauke'waɗanne zaɓuɓɓuka kuke so a nuna a cikin tashar ku. Gidan yanar gizon zai samar muku da lambar da ake buƙata da za ku ƙara a cikin fayil ɗin ~. / Bashrc ɗinku kamar yadda muka gani yanzu a cikin wannan labarin.

Gargadi- Wannan mummunan aiki ne a wasu yanayi. Misali, idan wasu bawo kamar zsh suka gaji bawon ku na yanzu, zai haifar da wasu matsaloli. Yi amfani dashi kawai don ɓoye ko gyara sunan mai amfani @ localhost idan kuna amfani da harsashi ɗaya. Baya ga ɓoye mai amfani @ localhost ɓangare a cikin tashar, wannan tip din bashi da aikin aiki kuma yana iya zama matsala a wasu takamaiman lamura, kodayake yana da kyau sanye sosai.


Bar tsokaci

Your email address ba za a buga. Bukata filayen suna alama da *

*

*

  1. Wanda ke da alhakin bayanan: Miguel Ángel Gatón
  2. Manufar bayanan: Sarrafa SPAM, sarrafa sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.