Tare da Terminal: Amfani da maganganu na yau da kullun

Ofaya daga cikin abubuwan da nake ƙaunata koyaushe game da tashar Linux shine abin da zaku iya cimma ta amfani da maganganu na yau da kullun. Ko muna buƙatar nemo rubutu mai rikitarwa ko maye gurbinsa da wani abu dabam, amfani da maganganu na yau da kullun na iya sauƙaƙa aikin sosai. Zai fara da farko:

GARGADI: Wannan rubutun ciwo ne a cikin jaki. Karanta wannan sakon a kowane lokaci na iya haifar da asarar hankali. Yi hutu a tsakanin ko tambayi likitanku ko likitan magunguna kafin karanta dukkan sakon.

Menene magana ta yau da kullun?

Maganganu na yau da kullun jerin haruffa ne na musamman waɗanda ke ba mu damar bayanin rubutu da muke son samu. Misali, idan muna son bincika kalmar "linux" zai isa mu sanya wannan kalmar a cikin shirin da muke amfani da shi. Kalmar kanta magana ce ta yau da kullun. Ya zuwa yanzu ga alama mai sauƙi ne, amma idan muna so mu sami duk lambobin a cikin wani fayil? Ko duk layukan da suka fara da babban baƙi? A waɗancan lokuta ba za ku iya ƙara sanya kalma mai sauƙi ba. Mafita ita ce amfani da magana ta yau da kullun.

Maganganu na yau da kullun da tsarin fayil.

Kafin mu shiga batun maganganu na yau da kullun, Ina so in warware rashin fahimtar juna game da maganganun yau da kullun. Maganganu na yau da kullun ba shine abin da muka sanya azaman siga a cikin umarni kamar rm, cp, da sauransu don komawa zuwa fayiloli daban-daban akan rumbun kwamfutar ba. Wannan zai zama tsarin fayil. Maganganu na yau da kullun, kodayake suna kama da cewa suna amfani da wasu haruffa gama gari, sun bambanta. Ana amfani da tsarin fayil akan fayilolin da ke kan rumbun kwamfutar kuma ya dawo da waɗanda suka dace da ƙirar sosai, yayin da magana ta yau da kullun ke aiki akan rubutu kuma ta dawo da layukan da ke ƙunshe da rubutun da aka bincika. Misali, bayanin yau da kullun yayi daidai da tsarin *.* zai zama wani abu kamar ^.*\..*$

Nau'in maganganu na yau da kullun.

Ba duk shirye-shirye suke amfani da maganganu iri ɗaya ba. Ba yawa ƙasa ba. Akwai nau'ikan maganganu na yau da kullun da yawa ko waɗanda ba na yau da kullun ba, amma akwai shirye-shiryen da ke canza tsarin haɓaka kaɗan, haɗa da nasu kari, ko ma amfani da haruffa daban daban. Sabili da haka, lokacin da kuke son amfani da maganganu na yau da kullun tare da shirin da ba ku san shi da kyau ba, abu na farko da za ku yi shi ne duba littafin jagora ko takaddar shirin don ganin yadda maganganun yau da kullun da ta gane suke.

Na farko, akwai manyan maganganu iri-iri na maganganu na yau da kullun, waɗanda ke ƙunshe cikin daidaitattun POSIX, wanda shine kayan aikin Linux ke amfani dashi. Su ne mahimman maganganu na yau da kullun. Yawancin umarnin da ke aiki tare da maganganu na yau da kullun, kamar su grep ko sed, suna ba ku damar amfani da waɗannan nau'ikan. Zan yi magana game da su a ƙasa. Hakanan akwai maganganu na yau da kullun na PERL, sannan kuma akwai shirye-shirye kamar vim ko emacs waɗanda ke amfani da ire-iren waɗannan. Dogaro da abin da muke son yi, yana iya zama mafi dacewa don amfani da ɗaya ko ɗaya.

Gwajin maganganu na yau da kullun.

Haɗin maganganun yau da kullun ba komai bane. Lokacin da ya kamata mu rubuta rikitarwa na yau da kullun zamu kasance a gaban kirtani na haruffa na musamman waɗanda ba za mu iya fahimta a kallon farko ba, don haka don koyon yadda ake amfani da su yana da mahimmanci a sami hanyar yin duk gwajin da muke so kuma ga sakamakon a sauƙaƙe. Wannan shine dalilin da yasa yanzu zan sanya dokoki da yawa waɗanda zamu iya yin gwaje-gwaje tare da gwaji duk abin da muke buƙata har sai maganganun yau da kullun sun mamaye mu.

Na farko shine umarnin grep. Wannan shine umarnin da zamuyi amfani dashi akai-akai don yin bincike. Aikin daidaitawa shi ne kamar haka:

grep [-E] 'REGEX' FICHERO
COMANDO | grep [-E] 'REGEX'

Ina ba da shawarar koyaushe sanya maganganu na yau da kullun a cikin maganganu guda don kada kwasfa ya tashi zuwa gare shi. Hanya ta farko ita ce nemo magana ta yau da kullun a cikin fayil. Na biyu yana ba da damar tace fitowar umarni ta hanyar magana ta yau da kullun. Ta hanyar tsoho, grep yana amfani da maganganu na yau da kullun. Zaɓin -E shine don amfani da maganganu na yau da kullun.

Dabarar da zata iya taimaka mana ganin yadda maganganu na yau da kullun ke aiki don ba da damar amfani da launi a cikin umarnin grep. Ta wannan hanyar, za a haskaka ɓangaren rubutun da ya dace da maganganun yau da kullun da muke amfani da su. Don kunna launi a cikin umarnin grep, kawai tabbatar cewa yanayin ya canza GREP_OPTIONS ƙunshe cikin ƙima --color, wanda za a iya yi tare da wannan umarnin:

GREP_OPTIONS=--color

Zamu iya sanya shi a cikin .bashrc don kunna shi koyaushe.

Wata hanyar amfani da maganganu na yau da kullun shine ta amfani da umarnin sed. Wannan ya fi dacewa don maye gurbin rubutu, amma kuma ana iya amfani dashi don bincike. Daidayan kalmomi a gare shi zai kasance kamar haka:

sed -n[r] '/REGEX/p' FICHERO
COMANDO | sed -n[r] '/REGEX/p'

Umurnin sed kuma yana amfani da maganganu na yau da kullun ta tsohuwa, zaku iya amfani da maganganu na yau da kullun tare da zaɓin -r.

Wani umarnin da nima ina son sanyawa shine awk. Ana iya amfani da wannan umarnin don abubuwa da yawa, saboda yana ba ku damar rubuta rubutun cikin yarenku na shirye-shiryenku. Idan abin da muke so shine neman magana ta yau da kullun a cikin fayil ko a cikin fitowar umarni, hanyar amfani da shi zai zama mai zuwa:

awk '/REGEX/' FICHERO
COMANDO | awk '/REGEX/'

Wannan umarnin koyaushe yana amfani da fadada maganganu na yau da kullun.

Don yin gwajin mu kuma zamu buƙaci rubutu wanda zai zama misali don bincika shi. Zamu iya amfani da rubutu mai zuwa:

- Lista de páginas wiki:

ArchLinux: https://wiki.archlinux.org/
Gentoo: https://wiki.gentoo.org/wiki/Main_Page
CentOS: http://wiki.centos.org/
Debian: https://wiki.debian.org/
Ubuntu: https://wiki.ubuntu.com/

- Fechas de lanzamiento:

Arch Linux: 11-03-2002
Gentoo: 31/03/2002
CentOs: 14-05-2004 03:32:38
Debian: 16/08/1993
Ubuntu: 20/10/2004

Desde Linux Rulez.

Wannan shine rubutun da zan yi amfani da shi don misalai a cikin sauran post ɗin, don haka ina ba ku shawara ku kwafa shi a cikin fayil don samun saukakke daga tashar. Zaku iya sanya sunan da kuke so. Na kira shi regex.

Farawa darasi.

Yanzu muna da duk abin da kuke buƙatar don fara gwada maganganun yau da kullun. Mu tafi kadan kadan. Zan sanya misalai da yawa na bincike tare da maganganu na yau da kullun wanda zan bayyana abin da kowane hali yake. Ba su da kyawawan misalai, amma tunda zan sami matsayi mai tsayi sosai, ba na so in ƙara rikitar da shi. Kuma zan kawai fifita abin da za a iya yi tare da maganganu na yau da kullun.

Mafi sauki shine bincika takamaiman kalma, misali, a ce muna son nemo dukkan layukan da suka ƙunshi kalmar "Linux". Wannan shine mafi sauki, tunda kawai zamu rubuta:

grep 'Linux' regex

Kuma zamu iya ganin sakamakon:

ArchLinux: https://wiki.archlinux.org/ Arch Linux: 11-03-2002 Daga Linux Rules.

Waɗannan su ne layuka uku da ke ɗauke da kalmar "Linux" wanda, idan muka yi amfani da dabarar launi, za ta bayyana da alama. Lura cewa yana gane kalmar da muke nema koda kuwa tana daga cikin kalmomin da suka fi tsayi kamar yadda yake a "ArchLinux". Koyaya, baya haskaka kalmar "linux" wanda ya bayyana a cikin URL ɗin "https://wiki.archlinux.org/". Wancan ne saboda a can ya bayyana tare da ƙaramin ƙaramin "l" kuma mun neme shi a cikin manyan haruffa. Umurnin mai gaɓa yana da zaɓuɓɓuka don wannan, amma ba zan yi magana a kansu ba a cikin labarin da ke magana game da maganganun yau da kullun.

Tare da wannan gwajin mai sauki zamu iya zana ƙarshe:

  • Halin al'ada wanda aka sanya a cikin magana ta yau da kullun yayi daidai da kanta.

Wanne shine cewa idan kun sanya harafin "a" zai nemi harafin "a". Da alama ma'ana, dama? 🙂

Yanzu a ce muna son bincika kalmar "CentO" ta kowane hali ke bi, amma hali ɗaya kawai. Don wannan za mu iya amfani da "." Hali, wanda yake alama ce ta daji wacce ta dace da kowane hali, amma ɗayan kawai:

grep 'CentO.' regex

Sakamakon shine:

CentOShttp://wiki.centos.org/
CentOs: 14-05-2004 03:32:38

Wanne yana nufin cewa ya haɗa da "S" a cikin "CentOS" kodayake a wani yanayin babban babba ne kuma a cikin wani ƙaramin ƙarami. Idan wani hali ya bayyana a waccan wurin, zai ma haɗa da shi. Muna da doka ta biyu:

  • Halin "." dace da kowane hali.

Ya zama ba ƙarama ba kamar yadda ake gani, amma da wannan ba za mu iya yin yawa ba. Bari mu ci gaba kadan. Bari mu ɗauka cewa muna son nemo layin da shekara ta 2002 da 2004 suka bayyana. Sun zama kamar bincike biyu ne, amma ana iya yin su gaba ɗaya kamar haka:

grep '200[24]' regex

Wanne yana nufin cewa muna son nemo lambar 200 biye da 2 ko 4. Kuma sakamakon shine:

Arch Linux: 11-03-2002
Gentoo: 31/03 /2002
Cibiyar: 14-05-2004 03:32:38
Ubuntu: 20/10/2004

Wanda ya kawo mu ga doka ta uku:

  • Maimaita haruffa da aka keɓe a cikin baka suna daidaita da kowane ɗayan haruffan da ke cikin sasannin.

Thearfafa ya ba da ƙarin wasa. ana iya amfani da su don keɓe haruffa. Misali, a ce muna son nemo rukunin yanar gizo inda halayen ":" ya bayyana, amma ba ya bi "/". Umurnin zai kasance kamar haka:

grep ':[^/]' regex

Abu ne kawai na sanya "^" azaman farkon halayya a cikin sashi. Zaku iya sanya duk haruffan da kuke so a ƙasa. Sakamakon wannan umarnin na ƙarshe shine mai zuwa:

ArchLinux: https://wiki.archlinux.org/
Gentoo: https://wiki.gentoo.org/wiki/Main_Page
CentOS: http://wiki.centos.org/
Debian: https://wiki.debian.org/
Ubuntu: https://wiki.ubuntu.com/
Arch Linux: 11-03-2002 Gentoo: 31/03/2002 CentOs: 14-05-2004 03:32:38 Debian: 16/08/1993 Ubuntu: 20 / 10 / 2004

Yanzu ana nuna alamar ":" a bayan sunayen ɓoyayyen, amma banda waɗanda ke cikin URLs ɗin saboda URLs ɗin suna da "/" a bayan su.

  • Sanya harafin "^" a farkon sashi ya yi daidai da kowane hali sai dai sauran haruffan da ke cikin sashin.

Wani abin da za mu iya yi shi ne tantance kewayon haruffa. Misali, don bincika kowane lamba da aka bi ta "-" zai yi kama da wannan:

grep '[0-9]-' regex

Da wannan muke tantance halin tsakanin 0 da 9 sannan kuma alamar debewa. Bari mu ga sakamakon:

Linux Arch: 11-03-Cibiyar 2002: 14-05-2004 03: 32: 38

Za'a iya ƙayyade jeri da yawa a cikin theanni don ma haɗa jeri da haruffa guda ɗaya.

  • Sanya haruffa biyu da "-" keɓe tsakanin maƙerarin ya dace da kowane hali a cikin kewayon.

Bari mu gani yanzu idan za mu iya zaɓar ɓangaren farko na URLs. Wanda yake cewa "http" ko "https". Sun bambanta ne kawai a cikin "s" na ƙarshe, don haka bari muyi shi kamar haka:

grep -E 'https?' regex

Ana amfani da alamar tambaya don sanya harafin hagu na zaɓi. Amma yanzu mun ƙara zaɓi -E zuwa umarnin. Wannan saboda tambaya abu ne na fadada maganganun yau da kullun. Ya zuwa yanzu muna amfani da maganganu na yau da kullun, don haka ba mu buƙatar saka komai a ciki. Bari mu ga sakamakon:

Rariya https: //wiki.archlinux.org/ Gentoo: https: //wiki.gentoo.org/wiki/Main_Page CentOS: http: //wiki.centos.org/ Debian: https: //wiki.debian.org/ Ubuntu: https: //wiki.ubuntu.com/

Don haka mun riga mun sami sabuwar doka:

  • Hali ya biyo baya "?" dace da wannan halin ko babu. Wannan yana aiki ne kawai don fadada maganganun yau da kullun.

Yanzu zamu sami kalmomi biyu mabanbanta. Bari mu ga yadda ake nemo layukan da suke dauke da kalmar "Debian" da "Ubuntu".

grep -E 'Debian|Ubuntu' regex

Tare da sandar tsaye za mu iya raba maganganu na yau da kullun daban-daban guda biyu kuma mu nemo layukan da suka dace da ɗayansu:

DebianYanar Gizo: https://wiki.debian.org/
Ubuntuhttps://wiki.ubuntu.com/
Debian: 16 / 08 / 1993
Ubuntu: 20 / 10 / 2004
  • Halin "|" hidimtawa ne don raba maganganu na yau da kullun da yawa tare da kowane ɗayansu. Hakanan ya keɓance don fadada maganganun yau da kullun.

Mu ci gaba. Yanzu za mu nemi kalmar "Linux", amma kawai inda ba ta manne da wata kalma ta hagu ba. Zamu iya yin hakan kamar haka:

grep '\

Anan mahimmin halin shine "<", amma yana buƙatar tserewa ta hanyar sanya "\" a gaban sa don grep ya fassarashi da halayya ta musamman. Sakamakon haka kamar haka:

Arch Linux: 11-03-2002 Daga Linux Rules.

Haka nan za ku iya amfani da "\>" don bincika kalmomin da ba su dace da juna ba. Bari mu tafi tare da misali. Bari mu gwada wannan umarnin:

grep 'http\>' regex

Sakamakon da yake samarwa shine:

CentOS: http: //wiki.centos.org/

"Http" ya fito, amma ba "https" ba saboda a cikin "https" har yanzu akwai hali a hannun dama na "p" wanda zai iya zama ɓangare na kalma.

  • Haruffa "<" da ">" sun dace da farkon da ƙarshen kalma, bi da bi. Wadannan haruffa dole ne su tsere don kada a fassara su a matsayin haruffa na zahiri.

Muna tafiya tare da abubuwa dan rikitarwa. Halin "+" ya dace da halin hagunsa, an maimaita shi aƙalla sau ɗaya. Ana samun wannan halin kawai tare da fadada maganganu na yau da kullun. Da shi za mu iya bincika, alal misali, jerin lambobi da yawa a jere waɗanda suka fara da ":".

grep -E ':[0-9]+' regex

Sakamakon:

Cibiyar: 14-05-2004 03: 32: 38

Hakanan an nuna lambar ta 38 saboda shima yana farawa da ":".

  • Halin "+" ya dace da halin hagunsa, an maimaita shi aƙalla sau ɗaya.

Haka nan za ku iya sarrafa lambar maimaitawa ta amfani da "{" da "}". Manufar ita ce a sanya a cikin braces lambar da ke nuna ainihin adadin maimaitawar da muke so. Hakanan zaka iya sanya kewayon. Bari mu ga misalan lamura biyu.

Da farko zamu nemo duk jerin lambobi huɗu waɗanda akwai:

grep '[0-9]\{4\}' regex

Lura cewa dole ne a tsere takalmin gyaran takalmin idan muna amfani da maganganu na yau da kullun, amma ba idan muna amfani da waɗanda aka faɗaɗa ba. Idan aka kara zai zama kamar wannan:

grep -E '[0-9]{4}' regex

Sakamakon haka a lokuta biyu zai zama wannan:

Arch Linux: 11-03-2002
Gentoo: 31/03 /2002
Cibiyar: 14-05-2004 03:32:38
Debian: 16/08/1993
Ubuntu: 20/10 /2004
  • Haruffa "{" da "}" tare da lamba tsakanin su sun dace da halayyar da ta gabata ta maimaita takamaiman adadin lokuta.

Yanzu sauran misalin tare da katakon takalmin gyaran kafa. A ce muna son nemo kalmomin da ke tsakanin ƙananan haruffa 3 da 6. Muna iya yin haka:

grep '[a-z]\{3,6\}' regex

Kuma sakamakon zai zama wannan:

- THEtsaya de Páginas wiki: ZUWARKLcikix: https: //wiki.archlinux.org/ Gshiga: https: //wiki.saliho.org/wiki/Main_Pshekaru
CentOS: http: //wiki.tsakiya.org/ Diyali: https: //wiki.debian.org/ KObuntu: https: //wiki.Ubuntu.com/ - Fka rasa de kaddamar: ZUWARK Lcikix: 11-03-2002 Gshiga: 31/03/2002 CentOs: 14-05-2004 03:32:38
Diyali: 16/08/1993 Ubuntu: 20/10/2004 DYana da Lcikix Rmalamai.

Wanne, kamar yadda kuke gani, bai yi kama da abin da muke so ba. Wannan saboda magana ta yau da kullun tana samo haruffa a cikin wasu kalmomin da suka fi tsayi. Bari mu gwada wannan wata sigar:

grep '\<[a-z]\{3,6\}\>' regex

Sakamakon:

- Jerin shafuka wiki: Tsakar Gida https: //wiki.archlinux.org/ Gentoo: https: //wiki.saliho.org/wiki/ Main_Page CentOS: http: //wiki.tsakiya.org/ Debian: https: //wiki.debian.org/ Ubuntu: https: //wiki.Ubuntu.com/

Wannan ya riga ya zama kamar abin da muke so. Abin da muka yi yana buƙatar kalmar ta fara kafin harafin farko kuma ta ƙare bayan na ƙarshe.

  • Haruffa "{" da "}" tare da lambobi biyu a tsakanin su waɗanda aka raba da wakafin wakafi halin da ya gabata ya maimaita adadin lokutan da lambobin biyu suka nuna.

Yanzu bari mu kalli halin da ke farkon "+". Yana da "*" kuma aikinsa yayi kamanceceniya, kawai yana dacewa da kowane adadin haruffa ciki har da sifili. Wato, yayi daidai da "+" amma baya buƙatar harafin hagunsa ya bayyana a rubutun. Misali, bari mu gwada neman waɗancan adiresoshin waɗanda suka fara kan wiki kuma suka ƙare akan org:

grep 'wiki.*org' regex

Bari mu ga sakamakon:

ArchLinux: https: //wiki.archlinux.org/ Gentoo: https: //wiki.gentoo.org/ wiki / Main_Page CentOS: http: //wiki.centos.org/ Debian: https: //wiki.debian.org/

Perfecto.

Yanzu hali na karshe wanda zamu gani. Ana amfani da harafin "\" don tserewa halayyar zuwa damarta don ta rasa mahimmancinta. Misali: A ce muna son gano layukan da suka ƙare a cikin aya. Abu na farko da zai iya faruwa a gare mu shine wannan:

grep '.$' regex

Sakamakon ba abin da muke nema ba:

- Jerin shafukan wiki:
ArchLinux: https://wiki.archlinux.org/
Gano: https://wiki.gentoo.org/wiki/Main_Page
CentOS: http://wiki.centos.org/
Debian: https://wiki.debian.org/
Ubuntu: https://wiki.ubuntu.com/
- Kwanan sakewa: Arch Linux: 11-03-2002
Gentoo: 31/03/2002
CentOs: 14-05-2004 03:32:38
Debian: 16/08/1993
Ubuntu: 20/10/2004
Daga Linux Rulez.

Wannan saboda "." yayi daidai da komai, don haka magana ta yau da kullun ta dace da halayen ƙarshe na kowane layi ko menene shi. Mafita ita ce:

grep '\.$' regex

Yanzu sakamakon shine abin da muke so:

Daga Linux Rulez.

Game a kan

Kodayake batun maganganun yau da kullun yana da rikitarwa da zan bayar don jerin labarai, Ina tsammanin na riga na baku isasshen ciwo. Idan kun sami nasarar zuwa, taya murna. Kuma idan kun karanta duk waɗannan sau ɗaya, ɗauki asfirin ko wani abu, saboda bazai iya zama mai kyau ba.

A yanzu haka ke nan. Idan kuna son wannan labarin, wataƙila kuna iya rubuta wani. A halin yanzu, Ina ba ku shawarar ku gwada duk maganganun yau da kullun a cikin tashar don ganin a fili yadda suke aiki. Kuma ka tuna: Chuck Norris ne kaɗai ke iya ɓoye HTML ta amfani da maganganu na yau da kullun.

 


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

28 comments, bar naka

Bar tsokaci

Your email address ba za a buga.

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da 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.

  1.   Ezequiel m

    Menene rayuwarmu zata kasance ba tare da regex ba?
    Labarin yanada fa'ida sosai, amma zan karanta shi kadan kadan. Godiya mai yawa.

    1.    hexborg m

      Na gode da sharhi. Har yanzu ban yarda labarin na ya fito ba. Ya fito da wasu kuskure, amma ina fatan yana da amfani. 🙂

  2.   Scalibur m

    Na gode youssssssss! ..

    Wani lokaci da suka wuce na yi nazarin kadan game da maganganun yau da kullun .. ..Na gode da koyarwa .. da kuma jagora mataki-mataki don koyon kowane ɗayansu ..

    Yayi kyau sosai! .. .. Zan sami asfirin kenan .. ee

    1.    hexborg m

      Marabanku. Couarfin gwiwa da maganganun yau da kullun ba zasu iya kasancewa tare da ku ba. 🙂

  3.   tanrax m

    Fantastic post! Babban aiki. Ina mamakin awoyi nawa suka ɗauke ku 😀

    1.    hexborg m

      LOL !! Tambayar ita ce: Awanni nawa ne zasu ɗauke ni idan na faɗi duk abin da niyyar in faɗi? Ba iyaka! 🙂

  4.   tammuz m

    abu daya ban sani ba, labari mai kyau!

    1.    hexborg m

      Na gode. Abin farin ciki ne raba maka shi.

  5.   helena_ryuu m

    babban bayani. barka da war haka! hakika fa'ida ce!

    1.    hexborg m

      Na yi farin ciki da kuka same shi da amfani. Don haka abin farin ciki ne a rubuta.

  6.   anti m

    Wannan ya kamata tafi wani wuri na musamman. Kamar fasalin amma kuna da takamaiman fa'ida. Da amfani sosai, kodayake ina son ganin an yi amfani da shi akan Vim.

    1.    hexborg m

      Tambayar da zan yiwa kaina kenan. Ina da wasu aan rubuce-rubuce game da maganganun yau da kullun. Kuma zan iya magana game da vim a cikinsu. Yana da wasu bambance-bambance daga abin da na bayyana a cikin wannan labarin. Abu ne na samun cigaba da shi. 🙂

  7.   Fernando m

    Yayi kyau!

    Labarinku yana da kyau kwarai da gaske, yana da ban sha'awa, kwanan nan (a yanzu) Na buga a shafin yanar gizzo na wanda na shirya na aan kwanaki inda na tattara jerin sunayen masarufi don maganganu na yau da kullun da wasu misalai. Kuma yayi daidai don shigar da DesdeLinux kuma ga shigarwa akan wannan batun!

    Idan wani ta'aziya ce, nawa nawa KYAU KYAU US

    Tabbas regex ɗayan abubuwa ne masu amfani, yawanci ina amfani dasu don rage fitowar umarni da kiyaye ɓangaren da yake so na, sannan kuma mu'amala da shi a cikin rubutun bash, misali. Na kuma yi amfani da su da yawa a jami'a, kuma suna da mahimmancin gaske wajen gina abubuwan tarawa (a cikin fassarar lafazinsa da fassarar sa). A takaice, duk duniya.

    Gaisuwa da aiki mai matukar kyau.

    1.    hexborg m

      Na gode sosai.

      Ina kuma son labarinku. Ya fi nawa takaice. Zai iya zama azaman bayani mai sauri. Haduwa ce da muka rubuta su a lokaci guda. Kuna iya ganin cewa mutane suna sha'awar batun. 🙂

  8.   Elery m

    Maganganu na yau da kullun don dummies =), yanzu ya fi bayyana a gare ni, ta wata hanya guda don samun fitarwa tare da launi don shafawa, shine ta ƙirƙirar laƙabi a .bashrc alias grep = 'grep –color = koyaushe', idan har yana aiki ne ga wani.

    gaisuwa

    1.    hexborg m

      Gaskiya. Wannan wata hanya ce ta yin hakan. Godiya ga shigarwar. 🙂

  9.   KZKG ^ Gaara m

    O_O… yanki na taimako !!! OO
    Na gode sosai da sakon, na kasance ina jiran wani abu makamancin haka na wani lokaci lol, na barshi a bude don karanta shi a natse a gida tare da rashin matsala don tattara hankali lol.

    Godiya ga labarin, da gaske nayi 😀

    1.    hexborg m

      Na san za ku so shi. LOL !! Gaskiyar ita ce, abubuwa da yawa sun ɓace, amma tuni na sami bangare na biyu a zuciyata. 🙂

  10.   Eliecer Tates m

    Babban labarin, da ace na karanta shi a jiya, darasin da nayi yau zai kasance ma da sauki ga ɗalibai na!

    1.    hexborg m

      LOL !! Ba daidai ba na yi latti, amma farin ciki yana da amfani. 🙂

  11.   LeoToro m

    A ƙarshe !!!, mafi kyau ga gidan…. A ƙarshe na sami wani abu wanda ke bayyane maganganun yau da kullun… ..

    1.    hexborg m

      Akwai bayanai da yawa a can, amma ya fi wuya a sami wani abu mai sauƙin fahimta. Na yi farin ciki da na cike wannan tazarar. 🙂

      Na gode.

  12.   Shakespeare Rhodes m

    Hey Ina bukatan taimako, dole ne nayi bincike a cikin / var / rajistan ayyukan tare da tsari: yymmdd, kuma rajistan ayyukan sun zo kamar 130901.log -130901.log, Dole ne in bincika duk waɗanda suke tsakanin Satumba 1 zuwa 11 ga Oktoba XNUMX , Abinda kawai na samu nayi shine cire duk watan Satumba amma ban san yadda ake yin cikakken sarkar ba:

    tsohon: 1309 [0-3] ya dawo da rajistan ayyukan tsakanin 1 ga Satumba zuwa 30, amma ban san yadda ake samun sa ba a cikin wannan sarkar daga 1 ga 11 ga Oktoba XNUMX.

    1.    hexborg m

      Yin shi ta amfani da maganganun yau da kullun yana da ɗan rikitarwa. Yana faruwa a gare ni cewa wani abu kamar wannan na iya aiki:

      13(09[0-3]|10(0|1[01]))

      Magana ce ta yau da kullun. Ba ku faɗi wane kayan aiki kuke amfani da shi ba, don haka ba zan iya ba ku ƙarin bayani ba.

      Duk da haka dai, ina tsammanin wannan batun ne maimakon amfani da maganganun yau da kullun yana da kyau a yi shi tare da nema. Kuna iya gwada wani abu kamar haka:

      sami. -newermt '01 sep '-a! -newermt '11 oct '- bugawa

      Sa'a. Fata wannan zai iya taimaka muku.

  13.   cizo m

    Barka dai, da farko, ina son in gode maku saboda aikin da kuke yi tunda wannan shafin yana cikin "saman 3" na mafi kyawun shafukan Linux.
    Ina cikin atisaye kuma ban san dalilin da yasa RegExp akan lambar waya bai yi min aiki ba kuma ya kasance na rasa "-E" (wanda na fahimci albarkacin wannan sakon).
    Ina so in tambaye ku idan baku san pdf mai kyau ko shafin yanar gizo ba inda ake yin atisaye a kan RegExp, kodayake tare da ɗan tunanin da zaku iya ƙirƙira su da kanku.

    Gaisuwa, Pablo.

  14.   Kalli m

    Yayi kyau sosai, kawai na karanta duka, kuma a yanzu ina bukatan asfirin 🙂

  15.   Oscar m

    Mafi kyawun bayani Na ga maganganun yau da kullun. Godiya ta ga marubucin don raba wannan aikin.

    A gaisuwa.

  16.   Alexander m

    Ina matukar son bayani mai kyau