Linux Crash Course - The sed Command

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 156

  • @fleborne
    @fleborne 3 года назад +69

    I believe the 's' before the search pattern actually stands for "substitute", not "string".

    • @andromida81
      @andromida81 2 года назад +6

      Yes you are correct

    • @PS_Tube
      @PS_Tube 2 года назад +1

      sed is called stream editor, which is what Jay said.

  • @alexo4600
    @alexo4600 3 года назад +60

    it's important to note that '-i' is a GNU only option - so it won't work on BSD or MacOS etc.

    • @martinschulz1778
      @martinschulz1778 2 года назад +1

      Just run into this, had to switch to gnu sed on my mac

    • @greendog105
      @greendog105 2 года назад +3

      oh that explains it all thnks

  • @MakeItWork256
    @MakeItWork256 11 месяцев назад +8

    Great tutorial. Unlike many other RUclipsr's you don't overcomplicate things. Linux at it's core is made out of a ton of simple idea's that become complicated when they all work together.

  • @simfoo
    @simfoo 3 года назад +8

    Your channel is one of those rare gems on RUclips

  • @crazyivan315
    @crazyivan315 3 года назад +96

    Finally, a way to easily remove pineapple from pizza topping lists.

    • @manny8717
      @manny8717 3 года назад +5

      Couldn’t agree more. Pineapple as a topping? HECK NO!!

    • @yewenyi
      @yewenyi Год назад +2

      Pineapple are good, so is feta. It should change it to both.

    • @k.chriscaldwell4141
      @k.chriscaldwell4141 3 месяца назад

      Amen!

  • @Ollital
    @Ollital 2 года назад +3

    I tried to understand sed for years. I guess now I've got it. Thank you

  • @shabadabadoo4326
    @shabadabadoo4326 3 года назад +9

    Doing linux webserver support for well over a decade, sed became a go-to tool for flipping switches in config files. That said, I know its a lot more powerful than what I ever did with it.

  • @mason8714
    @mason8714 3 года назад +16

    love seeing new videos like this for new people to linux. Jay's content is fantastic

  • @MurangShaBu_MahalNaBiGas
    @MurangShaBu_MahalNaBiGas 2 года назад +2

    Thank you Jay Linux is really vast, I just had my certification and I never heard of sed command. I'm glad your putting content for us.

  • @larrywilliams8010
    @larrywilliams8010 3 года назад +8

    sed 's/\/etc//' paths.txt
    Yeah, the command can get rather ugly when lots of escaped characters are needed, but it works and it's second nature for me since I often search for spaces and other characters that must be escaped anyway. Still, I appreciate that there is such an option in case someone wants to learn/use a different delimiter.
    Thanks for the video

  • @rcdenis1
    @rcdenis1 3 года назад +2

    I asked a college professor what sed was and I could not get a straight answer from him. Thanks Jay, now I understand. Thank you for posting.

  • @TradersTradingEdge
    @TradersTradingEdge 3 года назад +13

    I love these short session.
    Very codensed helpful stuff.
    Thanks Jay!

  • @jefferson4245
    @jefferson4245 Год назад

    This makes that sudoers line make all the sense now. I used to be afraid of sed, but now I can shell script more effectively. Thanks!

  • @anthonychaple3031
    @anthonychaple3031 3 года назад +3

    Not all heroes wear cape. Great videos. Go buy this man's book too

  • @thalcave8220
    @thalcave8220 3 года назад +2

    Sed is command that I couldn't understand when I was beginner. I learned it but did not understand. After few months of writing sed s/... I noticed that I understand what I was writing.

  • @BilalKhan-rm8qk
    @BilalKhan-rm8qk Год назад +3

    This is my first video, that i watched on your channel. You have explained it very nice and clear.

  • @souleymanebarry9231
    @souleymanebarry9231 5 месяцев назад

    Instead of changing the delimiter, you can use the backslash(\) before to escape the slash (/) just like this : sed 's/\/etc//'

  • @villico3
    @villico3 3 года назад +9

    you explain stuff very well and simple that makes it easy to grasp! thank you for sharing!

  • @alastairtheduke
    @alastairtheduke 9 месяцев назад

    You make understanding the basics so clear!

  • @dorotamartyniuq5553
    @dorotamartyniuq5553 3 года назад +1

    "maybe I'm just hungry, I have no idea why I decided to use pizza toppings as the basis for today's video, but you know what, I did what I did and here it is" it made my day

  • @ccroy2001
    @ccroy2001 3 года назад +1

    The word sed means thirst in Spanish. So have some Pineapple juice. Thanks I've set a goal to get better at the terminal so this helps.

  • @guypartush2976
    @guypartush2976 Год назад +1

    Hi Jay, LOVE your videos! Thank you so much for sharing your knowledge. please consider adding a video on the "w" and "who" commands. I realize it looks kind of obvious, but I am a total beginner in linux and your explanations of commands are the best.
    Looking forward to keep on learning.

    • @LearnLinuxTV
      @LearnLinuxTV  Год назад +1

      I completely agree that would be a great fit for my series. I will add it to my list.

  • @TR1ckY_TV
    @TR1ckY_TV 3 года назад +4

    Finally!!! 🔥 🔥 🔥
    Thank you Sir for put the effort in making these amazing videos

  • @Rebel101
    @Rebel101 2 года назад +1

    I've just suggested the topic on your new video and saw this covered already afterwards.
    Thank you!

  • @bobwong8268
    @bobwong8268 3 года назад +4

    👍👍👍👍👍
    Thanks!
    This is a great first-step into the wonderful world of /sed/.

  • @polliluiz
    @polliluiz Год назад

    You are awesome mr. Lacroix. The best Linux guy ever

  • @zeeeeeman
    @zeeeeeman Год назад +1

    video starts at 2:00

  • @billquain2369
    @billquain2369 3 года назад +2

    I didn't know that you could change the delimiter to a different character. this would have come in handy last year when I took a Unix/Linux course at college

    • @chromerims
      @chromerims Год назад

      Incredible information that sed delimiter can be something other than /
      I too had no idea.
      I look fwd to using other delimiters with sed.

  • @MaximumRD
    @MaximumRD 3 года назад +5

    He sed, She sed......................I'll see myself out......

  • @stevenoderayi5776
    @stevenoderayi5776 2 года назад +3

    ‘sed’ is short for ‘stream editor’, for those who’re wondering what the command means.

  • @brandonhunter3036
    @brandonhunter3036 2 года назад +1

    Thanks man that's what I needed to know. Glad the video was short and to the point.

  • @riccoc.6507
    @riccoc.6507 2 года назад

    Thank you for showing syntax

  • @VijayaBaskarvvk
    @VijayaBaskarvvk Год назад +1

    Great explanation.. subscribed😊.. One video is enough to understand the teacher's ability...

  • @mnmleung
    @mnmleung Год назад +1

    Thank you for very clear presentation and explanation.

  • @devilmaycry0204
    @devilmaycry0204 Год назад +1

    Simple and straight forward, thanks man

  • @pnachtwey
    @pnachtwey 2 года назад

    I use sed to edit edit the output of a pip command that updates all my outdated python packages. The output goes to a xargs command

  • @strifef7
    @strifef7 3 года назад +1

    rude Jay! Pineapple is the GOAT on pizza!!

  • @kazishafin1
    @kazishafin1 2 года назад

    Happy to found this channel,

  • @itbook182
    @itbook182 3 года назад +3

    Good morning, Jay. Thank you very much for the detailed guides ! I have an old Toshiba Portege 14" Laptop with Kali 10.04 still installed there. Recently, I wanted to use it for a monitoring device and reinstall it but it is giving the "no pae"- error (common for the very old hardware). It doesn't boot from USB, only from CD/DVD. Do you think, I can still use it to install a Linux OS on it (I wouldn't mind being only CLI - I need it just to be able to install software to monitor my network), and which one you would propose if yes ? Thank you in advance. Asen

    • @swarooprajpurohit110
      @swarooprajpurohit110 2 года назад +1

      You could use a distro which doesn't require pae or install an older version of kali and then upgrade it

  • @vladimirkulakov8667
    @vladimirkulakov8667 Год назад

    oh man... we can use any delimeter!! not only / !!! Thank you! )

  • @shajibdey6451
    @shajibdey6451 Год назад

    et(44)1,tet(37)1,oqxB1,VanX-D4,VanX-D4,tet(O)2,aadA51,VanR-G1,
    here how can I remove everything that comes only after the bracket () by using sed??

  • @linuxdoesmatter5542
    @linuxdoesmatter5542 11 месяцев назад

    You are a genius!!!!! Than you 4 teaching me!!!

  • @adammureiko7508
    @adammureiko7508 3 года назад +1

    And what, may I ask, is wrong with Pineapple?

  • @freyclante1766
    @freyclante1766 2 года назад +1

    I just love that comment about Pineapple as a Pizza topping! Hell No! I couldn't agree more 🙂

  • @busyrand
    @busyrand 8 месяцев назад

    Fantastic explaination... Thank you Sir...

  • @Nonsense116
    @Nonsense116 3 месяца назад

    video starts @3:30

  • @dalirch8496
    @dalirch8496 Год назад

    thanks for your effort and explanation

  • @BlindRambler
    @BlindRambler 3 года назад +1

    Oh no, no, no. I must change every topping to pineapple. This is not allowed to stand. Thanks for showing me how to use sed to do that. You are very kind, but very wrong.

  • @the-baker
    @the-baker 2 года назад +1

    This tutorial is amazing. Well done.

  • @Ranblv
    @Ranblv 3 года назад

    I think the s stands for substitute not string

  • @YannMetalhead
    @YannMetalhead 7 месяцев назад

    Great explanation!

  • @antoineweb1
    @antoineweb1 10 месяцев назад

    how about the /g at the end? chatGPT tells me that if you don't add /g at the end, it will only substitute the word once per line, which may not be enough

    • @antoineweb1
      @antoineweb1 10 месяцев назад

      for example: echo "a a" | sed s/a/b/ gives "b a" as output

  • @chessmaster856
    @chessmaster856 2 года назад

    How do you undo if find and replace was wrong? Notepad++ can find and replace across all files from ui. You don't need Unix command for that. Also it can undo it. Can you undo from unix????

  • @muralikrishna9748
    @muralikrishna9748 2 года назад

    Wondering what would be the script if I want to replace only the last occurance in the last line of the word Pineapple with Olives in your example file ?

  • @ChristianDavis-x5z
    @ChristianDavis-x5z Год назад

    '...something EXTREMELY WRONG with this file.' LOL I'm with you, Jay. Pineapple on pizza--I'm OUT. Thanks for the help on delimiters.

  • @nobilkwt7222
    @nobilkwt7222 3 года назад +1

    what about a video about chroot

  • @john-r-edge
    @john-r-edge 3 года назад +2

    Not sure ordinary mortals can master both sed and awk.

  • @elnurvalikhanli6783
    @elnurvalikhanli6783 2 года назад

    Amazing command and tutorial thanks

  • @tonyfreehauf4463
    @tonyfreehauf4463 Год назад

    Great Job .... but more more on sed and awk .. thanks - oldtony

  • @derekfrost8991
    @derekfrost8991 3 года назад

    The option i followed by a suffix creates a backup = -i.bak this is important as -i can be dangerous.. :)

  • @vladimirtorres1181
    @vladimirtorres1181 2 года назад

    Wow new subscriber. Really good explanation! TY

  • @tolstoievski4926
    @tolstoievski4926 Год назад

    what is the difference between -i and -i.bak ?

  • @debeeriz
    @debeeriz 3 года назад

    i was playing around with it to change one letter in a word to another letter and it worked but only in the first word in each line with the letter. Other occasions of the letter remain unchanged

    • @debeeriz
      @debeeriz 3 года назад

      found out how add a g for global quidsup explains it in more detail

  • @oldpain7625
    @oldpain7625 11 месяцев назад

    "What are some cool cli apps?"
    "sed and awk"

  • @danperrault
    @danperrault Год назад

    That was very helpful. thanks

  • @venkateshiyer5073
    @venkateshiyer5073 Год назад

    thank you sir, very helpful

  • @navasr7969
    @navasr7969 2 года назад

    I have data like "Chair"||"Table"|||"Sofa".. How to add double quotes between each pipeline like "Chair"|""|"Table"|""|""|"Sofa" .. Please let me knw the command

    • @RKulov
      @RKulov 5 месяцев назад

      Sed the pipe with "|"

  • @nobilkwt7222
    @nobilkwt7222 3 года назад +5

    I want to eat a pizza now 😂🤣😂🤣😂🤣😂🤣😂😂🤣😂🤣🤣🤣

    • @xrafter
      @xrafter 3 года назад

      Pineapple pizza ?

  • @محمّد.09
    @محمّد.09 4 месяца назад

    that s is for substitute right.

  • @sohaibesohaib2914
    @sohaibesohaib2914 5 месяцев назад

    the video starts at 1:20

  • @guilherme5094
    @guilherme5094 3 года назад

    Thanks Jay.

  • @terraflops
    @terraflops Год назад

    i had issues only because i left out the / after feta (feta/)

  • @brentrambo2571
    @brentrambo2571 Год назад

    You sed yes, I sed no
    You sed stop and I sed go go go, oh no
    You sed goodbye and I sed hello
    Hello hello
    I don't know why you sed goodbye, I sed hello
    Hello hello
    I don't know why you sed goodbye, I sed hello

  • @sivaprasadk4756
    @sivaprasadk4756 2 года назад

    Nice...very useful

  • @AM-cz7qy
    @AM-cz7qy Год назад

    Thank you very much

  • @Acksakal
    @Acksakal 8 месяцев назад

    Thank you

  • @janekmachnicki2593
    @janekmachnicki2593 Год назад

    thanks mate for suspenseful tutorial

  • @ismaeelhaider3075
    @ismaeelhaider3075 11 месяцев назад

    Awesome 🥰

  • @Blubberland
    @Blubberland Год назад

    3:10 instant like

  • @vikasmahour6059
    @vikasmahour6059 Год назад

    Thanks for your vedios.
    I am stuck in a problem .
    My XMl FIle contains data like :

    1234


    2345


    8787987


    89898


    80098

    I want to arrange my xml file such that the tags and should be in a single line without space.

    1234


    2345

    8787987

    89898

    80098
    Tried many sed commands but no luck.Please help me to resolve it .

  • @ivanm9186
    @ivanm9186 Год назад

    CHICKEN PINEAPPLE PIZZA IS THE BEST and PERIOD!

  • @noeelreeds
    @noeelreeds 7 месяцев назад

    now i can proceed w automations

  • @spacelem
    @spacelem 4 месяца назад

    Sitting here watching the video while eating a ham and pineapple pizza...

  • @kythrathesuntamer9715
    @kythrathesuntamer9715 Год назад

    Thanks.

  • @mohamedhussien4013
    @mohamedhussien4013 Год назад

    Thank u so much.

  • @hailelove1
    @hailelove1 2 года назад

    good job

  • @narayangurung7090
    @narayangurung7090 10 месяцев назад

    Fantastic

  • @algabsi6323
    @algabsi6323 2 года назад

    Thanks

  • @ThodoreErnest-m6b
    @ThodoreErnest-m6b 2 месяца назад

    Noelia Harbor

  • @BrianWalker-c8u
    @BrianWalker-c8u 2 месяца назад

    Luna Ridges

  • @khomo12
    @khomo12 2 года назад

    Nice!

  • @srsr6099
    @srsr6099 3 года назад

    Awesome again. Now I have awk sed & $bash ?

    • @xrafter
      @xrafter 3 года назад

      ّ

    • @xrafter
      @xrafter 3 года назад

      bash: Now: command not found

    • @srsr6099
      @srsr6099 3 года назад

      sudo apt-get update, could help

  • @chessmaster856
    @chessmaster856 2 года назад

    Is Unix dinosaur or not?

  • @AnzanHoshinRoshi
    @AnzanHoshinRoshi 3 года назад

    Thank you, Jay.

  • @redshepard5306
    @redshepard5306 2 года назад +1

    as a pizza delivery driver who is an aspiring linux user, This tutorial was perfect.
    that being said,
    Pineapple_Pizza = "The Best"

  • @SandraSmith-d2z
    @SandraSmith-d2z Месяц назад

    Rath Turnpike

  • @TaunyaRoseberry-t6r
    @TaunyaRoseberry-t6r 2 месяца назад

    Shirley Spring

  • @subee128
    @subee128 9 месяцев назад

    Thank u

  • @TomikoLinne
    @TomikoLinne 2 месяца назад

    9450 Aliza Orchard

  • @JohnsonFitch
    @JohnsonFitch 2 месяца назад

    505 Sunny Branch