Yuav ua li cas lawb tawm cov kab tshwj xeeb los ntawm cov ntaub ntawv siv sed

Qee lub sijhawm peb yuav tsum tau lawb tawm cov kab ntawv tshwj xeeb los ntawm ntau cov ntawv lossis ntau yam, piv txwv, nws tau tshwm sim rau kuv tias kuv tau muaj tag nrho cov npe ntawm cov ntaub ntawv thiab kuv xav rho tawm kab # 27 ntawm tag nrho cov no (kab # 27 yog ntawm ACL , kev cai, kev cai, kev teeb tsa), Kuv tuaj yeem hloov kho cov ntawv los ntawm cov ntaub ntawv lossis kuv tuaj yeem ua tiav qhov kuv xav tau siv cov lus txib sed thiab ib tsab ntawv bash (yeem).

Tab sis, cia peb sim ua ib daim ntawv yooj yim me ntsis.

Peb muaj cov ntaub ntawv cuam ​​tshuam-deb.txt uas muaj qhov no:

debian

kubuntu

archlinux

cov kev daws teeb meem

mint

Hauv lwm lo lus, cov ntaub ntawv cuam ​​tshuam-deb.txt yog qhov uas peb yuav muab qhov cuam tshuam Debian-based cuam tshuam, tab sis nyob ntawd peb pom tias ntawm kab # 3 muaj "archlinux", ib qho kev cuam tshuam uas pom tias tsis muaj dab tsi rau Debian, yog li peb yuav tsum tshem tawm txoj kab ntawd. Txhawm rau tshem tawm kab # 3 ntawm cov ntawv ntawd peb yuav tso rau hauv qab no:

sed "3d" distros-deb.txt > distros-deb-ok.txt

Piav cov kab no yog qee qhov yooj yim, nrog nqhis dej "3D" peb tab tom qhia tias peb yuav rho tawm kab # 3, nrog cuam ​​tshuam-deb.txt Peb taw qhia cov ntaub ntawv dab tsi los ua haujlwm ntawm, uas yog, rho tawm kab # 3 ntawm cov ntaub ntawv no, mus txog rau ntawm no yog tias peb nias Enter nws yuav qhia peb qhov peb xav tau tab sis nyob hauv qhov davhlau ya nyob twg, yog li nrog > distros-deb-ok.txt peb tab tom qhia tias tsis txhob qhia qhov tshwm sim hauv qhov xaus, kom muab tso rau hauv cov ntaub ntawv nrog lub npe no.

Dab tsi yog qhov yooj yim?

Tsis tas li, peb tuaj yeem zam tsis siv qhov > distros-deb-ok.txt siv tus qauv tsim nyog ntawm sed, ntsuas qhov tsis -i

Ntawd yog, nyob rau hauv rooj plaub uas peb xav kom tshem tawm kab ntawm cov ntawv thiab khaws nws nrog tib lub npe (thiab tsis yog nyob rau lwm daim ntawv), tsuas yog ntxiv cov parameter -i :

sed -i "3d" distros-deb.txt

Qhov no yuav tshem tawm kab # 3 los ntawm distros-deb.txt thiab khaws nws.

Yuav ua li cas yog tias kuv xav tau ntau txoj kab, uas yog tshem kab # 3 tab sis kuj yog # 4 thiab # 5? Yuav kom ua tiav qhov no peb tso qhov ntau ntawm 3 txog 5, uas yog:

sed -i "3,5d" distros-deb.txt

Thiab nws yuav qhia kuv tsuas debian thiab kubuntu 😀

Yog li yog tias kuv xav rho tawm ntawm kab 2 mus rau kab kawg, thaum kuv tsis paub tag nrho cov kab?

Tsuas siv cov cim cim daus - »$

sed -i "2,$d" distros-deb.txt

Nyob rau hauv rooj plaub koj xav kom tshem tawm los ntawm thawj kab rau # 4 ces peb tsuas tso qhov muaj nqis 1 thaum pib:

sed -i "1,4d" distros-deb.txt

Qhov no tau ua txhua yam, lub tswv yim zoo heev thaum koj xav ua bash scripts rau automate paub tab thiab koj yuav tsum tau hloov kho thiab tshem tawm kab ntawm cov ntaub ntawv teeb tsa, hloov kho peb tuaj yeem siv sed o pearlKuj yog kev tshem tawm peb twb paub yuav ua li cas nws ua sed nrog sed

regards


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.

16 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.   mss-kev said

    Kev koom tes zoo heev 😉

    1.    KZKG ^ Gaara said

      Ua tsaug

      Los ntawm txoj kev, peb tau txais koj email tam sim no Kuv yuav teb koj 😀

      regards

  2.   tsis muaj npe said

    Raws li tus pov thawj hlob ntawm lub davhlau ya nyob twg, servers thiab ssh kev sib txuas Kuv tuaj rau koj, huag loj KZKG ^ Gaara, thiab kuv nug koj: qhov twg kuv tuaj yeem tau txais kev qhia ntawm qib ntawm kuv qhov tsis lees paub uas tso cai rau kuv siv kev sib txuas ssh ntawm ob lub tshuab deb ntawm cov tes hauj lwm sib txawv. cov ntawv sau, pdf, duab thiab suab (mp3)….

    🙂

    Tiag tiag, koj puas tuaj yeem coj kuv hauv qhov no, Kuv muaj ob lub tshuab, ib qho ntawm kev ua haujlwm thiab ib tus nyob hauv tsev thiab kuv xav tau ssh kev sib txuas ntawm lawv (vim tias raws li kuv nkag siab nws, ssh pub cov ntsiab lus faib tawm ntawm cov tshuab, puas yog kuv?
    Thiab yog tias kuv ua tsis ncaj ncees lawm, koj pom zoo li cas thov?
    Thiab qhov twg kuv yuav nrhiav tau cov kev qhia ua ntu zus hauv qhov no?

    1.    -Spyker- said

      ua scp.

      scp neeg siv @ tshuab_address: kev siv @ tshuab_address: kev.

      Tib syntax li cp, qhov -> lo lus uas peb tau.

  3.   F3niX said

    Koj tsom tus txiv neej, koj tau ploj.

  4.   Joaquin said

    Cov Lus Qhia Zoo!

  5.   LycusHackerEmo said

    Lus nthuav tawm… xD

    Koj puas tshwm sim kom paub ib qho uas ua rau cov ntawv nyeem tsis meej?
    Kuv txhais tau tias, Kuv muaj ib daim ntawv txt uas yog phau ntawv txhais lus, nws muaj ntau dua 10000 kab thiab kuv xav kom nws hais txog qee yam ntawv nyeem ua ntej ntawm ":" cov ntsiab lus raug ncua thiab ua ib qho los ntawm ib qho yog ntau dhau lawm.

    1.    KZKG ^ Gaara said

      nyob zoo,

      Ib daim ntawv txt yog cov ntawv nyeem yooj yim, raws li nws lub npe cuam tshuam ... dawb, tsis muaj hom lossis lwm yam zoo sib xws, Kuv thov txim tab sis kuv tsis xav tias qhov koj thov tuaj yeem ua tiav, puas yog? 🙁

      regards

      1.    aca said

        ua rau nws tuaj yeem, tab sis koj yuav tsum paub cov hom phiaj.
        Piv txwv li:
        ncha $ (ncha "Robert: Nyob zoo. Hloov ntawm no" | sed 's / \ ./. \\ e [40; 31m /; s / \: /: \\ e [40; 35m /')
        nws yog teeb meem daws.
        lwm txoj hauv kev rho tawm uas tuaj yeem siv yog sed '/' $ 1 '/ d' tab sis koj yuav tsum paub tseeb ntawm tus re.

        1.    LycusHackerEmo said

          tom qab ntawd ua tiav nws hauv * .odt

          Puas muaj ib txoj hauv kev yooj yim dua los ua nws nrog LibreOffice?

  6.   lol said

    Koj tuaj yeem tshem tawm ib feem ntawm kab thiab tawm ntawm cov tas?

    Cia hais tias kuv xav rho tawm txhua yam ua ntej ntawm ib lo lus hauv kab kiag.

    Los yog lwv txhua yam uas ua raws lo lus ntawd.

    1.    aca said

      Yog lawm, nws muaj teeb meem ntawm rub lub regex (yog tias tsim nyog txiv neej -r, –regexp-ncua)
      Pib ntawm qhov kuv pom
      ncha «Robert: Nyob zoo. Hloov ntawm no »| sed 's / Hloov //'
      nrog tus qauv pom zoo thiab nrog. (ib qho cim) thiab * (ntau dua ib tus)
      Tom qab:
      ncha «Robert: Nyob zoo. Hloov ntawm no »| sed 's / Pauv. * //'
      Ua ntej:
      ncha «Robert: Nyob zoo. Hloov ntawm no »| sed 's /. * Pauv //'
      Yog tias nws muaj txiaj ntsig tias lo lus tshwm tuaj
      ncha «Robert: Nyob zoo. Hloov ntawm no »| sed 's / Hloov. * / Hloov /'
      lossis piav ntau yam ntxiv
      hauv kab uas muaj Robert dab tsi mus tom qab Hloov
      ncha -e «Fritz: Nyob zoo. Hloov ntawm no \ nRobert: Nyob zoo. Hloov ntawm no »| sed '/Robert/s/Cambio.*//'
      los yog zoo li thaum pib coj tawm kab thib ob thiab cov txheej txheem seem
      ncha -e «Fritz: Nyob zoo. Hloov ntawm no \ nRobert: Nyob zoo. Hloov ntawm no \ nXwb »| sed -e 2d -e 's / Hloov. * //'
      ncha -e «Fritz: Nyob zoo. Hloov ntawm no \ nRobert: Nyob zoo. Hloov ntawm no \ nXwb »| sed '2d; s / Pauv. * //'

      1.    lol said

        Ua tsaug, nws yog qhov tseem ceeb rau kuv.

  7.   msx said

    Cov ntawv xov xwm zoo, uas kuv nyiam, zoo npaum li cas rau SysAdmin!
    Dab tsi yuav peb lub neej yuav tsis muaj sed, awek, perl, grep, tw, taub hau, "Emacs" thiab ntau lwm cov cuab yeej tseem ceeb!?

  8.   Lisbeth Ollarves said

    Ua tsaug, nws yog qhov pab tau zoo heev.

  9.   Laj Sab Pern said

    Nyob zoo, thiab ua li cas koj tuaj yeem tshem tawm cov kab 1,4 thiab 10 los ntawm cov ntawv sau rau hauv tib tus txib?