Linux Crash Course - The sed Command

  Переглядів 110,733

Learn Linux TV

Learn Linux TV

2 роки тому

In this episode of Linux Crash Course, we explore the sed command. sed, aka the "stream editor" is an underused command, and that's a shame because it's extremely useful for manipulating text. In this video, I'll show you the basics of the sed command.
LearnLinuxTV Sites
🐧 Main site:
➡️ www.learnlinux.tv
🐧 LearnLinuxTV Community:
➡️ community.learnlinux.tv
Support LearnLinuxTV (commission earned)
☁️ Support LearnLinuxTV and Set up your own cloud server with Akamai Connected Cloud:
➡️ learnlinux.link/akamai
📖 Check out Jay's latest book, Mastering Ubuntu Server 4th Edition. Covers Ubuntu 22.04!
➡️ ubuntuserverbook.com
🙌 Support me on Patreon and get early access to new content!
➡️ learnlinux.link/patron
🛒 Affiliate store for Linux compatible hardware/accessories:
➡️ learnlinux.link/amazon
💻 Check out the Tiny Pilot KVM for your Homelab:
➡️ learnlinux.link/tinypilot
About Me
🐦 Follow me on Twitter!
➡️ learnlinux.link/twitter
👨 More about me:
➡️ www.jaylacroix.com
➡️ www.learnlinux.tv
Recommended evergreen videos:
💽 How to create a bootable flash drive for installing Linux
➡️ linux.video/flash-usb
🐧 Understanding Linux permissions
➡️ linux.video/perms
🐧 OpenSSH Guide
➡️ linux.video/ssh
📖 LVM Deep-dive:
➡️ linux.video/lvm
🔐 How to better secure OpenSSH:
➡️ linux.video/secure-ssh
☁️ How to create a cloud Linux server with Linode:
➡️ learnlinux.link/create-linode
FAQ
🐧 Which distro do I use?
➡️ learnlinux.link/mydistro
💽 My recording gear (commissions earned):
➡️ learnlinux.link/recording-stuff
#CLI#Linux #sed

КОМЕНТАРІ: 129
@mezlo64
@mezlo64 2 роки тому
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 роки тому
Just run into this, had to switch to gnu sed on my mac
@greendog105
@greendog105 Рік тому
oh that explains it all thnks
@fleborne
@fleborne 2 роки тому
I believe the 's' before the search pattern actually stands for "substitute", not "string".
@andromida81
@andromida81 2 роки тому
Yes you are correct
@PS_Tube
@PS_Tube Рік тому
sed is called stream editor, which is what Jay said.
@MakeItWork256
@MakeItWork256 4 місяці тому
Great tutorial. Unlike many other UKpostsr'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.
@TradersTradingEdge
@TradersTradingEdge 2 роки тому
I love these short session. Very codensed helpful stuff. Thanks Jay!
@crazyivan315
@crazyivan315 2 роки тому
Finally, a way to easily remove pineapple from pizza topping lists.
@manny8717
@manny8717 2 роки тому
Couldn’t agree more. Pineapple as a topping? HECK NO!!
@yewenyi
@yewenyi 7 місяців тому
Pineapple are good, so is feta. It should change it to both.
@simfoo
@simfoo 2 роки тому
Your channel is one of those rare gems on UKposts
@mason8714
@mason8714 2 роки тому
love seeing new videos like this for new people to linux. Jay's content is fantastic
@Ray_TambaBudol_Marcos
@Ray_TambaBudol_Marcos Рік тому
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.
@villico3
@villico3 2 роки тому
you explain stuff very well and simple that makes it easy to grasp! thank you for sharing!
@Rebel101
@Rebel101 2 роки тому
I've just suggested the topic on your new video and saw this covered already afterwards. Thank you!
@BilalKhan-rm8qk
@BilalKhan-rm8qk Рік тому
This is my first video, that i watched on your channel. You have explained it very nice and clear.
@Ollital
@Ollital 2 роки тому
I tried to understand sed for years. I guess now I've got it. Thank you
@TR1ckY_TV
@TR1ckY_TV 2 роки тому
Finally!!! 🔥 🔥 🔥 Thank you Sir for put the effort in making these amazing videos
@brandonhunter3036
@brandonhunter3036 Рік тому
Thanks man that's what I needed to know. Glad the video was short and to the point.
@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!
@shabadabadoo4326
@shabadabadoo4326 2 роки тому
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.
@anthonychaple3031
@anthonychaple3031 2 роки тому
Not all heroes wear cape. Great videos. Go buy this man's book too
@the-baker
@the-baker Рік тому
This tutorial is amazing. Well done.
@alastairtheduke
@alastairtheduke 2 місяці тому
You make understanding the basics so clear!
@devilmaycry0204
@devilmaycry0204 Рік тому
Simple and straight forward, thanks man
@mnmleung
@mnmleung Рік тому
Thank you for very clear presentation and explanation.
@VijayaBaskarvvk
@VijayaBaskarvvk Рік тому
Great explanation.. subscribed😊.. One video is enough to understand the teacher's ability...
@bobwong8268
@bobwong8268 2 роки тому
👍👍👍👍👍 Thanks! This is a great first-step into the wonderful world of /sed/.
@dillon1012
@dillon1012 2 місяці тому
You sed it
@larrywilliams8010
@larrywilliams8010 2 роки тому
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
@kazishafin1
@kazishafin1 2 роки тому
Happy to found this channel,
@dalirch8496
@dalirch8496 Рік тому
thanks for your effort and explanation
@dorotamartyniuq5553
@dorotamartyniuq5553 2 роки тому
"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
@guypartush2976
@guypartush2976 5 місяців тому
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 5 місяців тому
I completely agree that would be a great fit for my series. I will add it to my list.
@busyrand
@busyrand Місяць тому
Fantastic explaination... Thank you Sir...
@polliluiz
@polliluiz Рік тому
You are awesome mr. Lacroix. The best Linux guy ever
@vladimirtorres1181
@vladimirtorres1181 2 роки тому
Wow new subscriber. Really good explanation! TY
@elnurvalikhanli6783
@elnurvalikhanli6783 Рік тому
Amazing command and tutorial thanks
@venkateshiyer5073
@venkateshiyer5073 9 місяців тому
thank you sir, very helpful
@YannMetalhead
@YannMetalhead 21 день тому
Great explanation!
@guilherme5094
@guilherme5094 2 роки тому
Thanks Jay.
@linuxdoesmatter5542
@linuxdoesmatter5542 4 місяці тому
You are a genius!!!!! Than you 4 teaching me!!!
@danperrault
@danperrault Рік тому
That was very helpful. thanks
@riccoc.6507
@riccoc.6507 2 роки тому
Thank you for showing syntax
@thalcave8220
@thalcave8220 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.
@rcdenis1
@rcdenis1 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.
@billquain2369
@billquain2369 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 7 місяців тому
Incredible information that sed delimiter can be something other than / I too had no idea. I look fwd to using other delimiters with sed.
@Acksakal
@Acksakal 2 місяці тому
Thank you
@mohamedhussien4013
@mohamedhussien4013 11 місяців тому
Thank u so much.
@sivaprasadk4756
@sivaprasadk4756 Рік тому
Nice...very useful
@ismaeelhaider3075
@ismaeelhaider3075 4 місяці тому
Awesome 🥰
@narayangurung7090
@narayangurung7090 4 місяці тому
Fantastic
@khomo12
@khomo12 2 роки тому
Nice!
@hailelove1
@hailelove1 Рік тому
good job
@chandrashekars9855
@chandrashekars9855 Рік тому
Thanks
@kythrathesuntamer9715
@kythrathesuntamer9715 9 місяців тому
Thanks.
@AM-cz7qy
@AM-cz7qy 5 місяців тому
Thank you very much
@LearnLinuxTV
@LearnLinuxTV 5 місяців тому
You are welcome
@muralikrishna9748
@muralikrishna9748 Рік тому
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 ?
@vladimirkulakov8667
@vladimirkulakov8667 10 місяців тому
oh man... we can use any delimeter!! not only / !!! Thank you! )
@itbook182
@itbook182 2 роки тому
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 роки тому
You could use a distro which doesn't require pae or install an older version of kali and then upgrade it
@kychemclass5850
@kychemclass5850 7 місяців тому
I have a sub-string in a line e.g. id=84. How to use the sed command to 'read' the number immediately after the "id=" and dump it into a variable?
@buysnoah
@buysnoah 4 місяці тому
Idk
@ccroy2001
@ccroy2001 2 роки тому
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.
@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
@subee128
@subee128 2 місяці тому
Thank u
@user-gm6ok9iq8e
@user-gm6ok9iq8e 7 місяців тому
'...something EXTREMELY WRONG with this file.' LOL I'm with you, Jay. Pineapple on pizza--I'm OUT. Thanks for the help on delimiters.
@tonyfreehauf4463
@tonyfreehauf4463 Рік тому
Great Job .... but more more on sed and awk .. thanks - oldtony
@janekmachnicki2593
@janekmachnicki2593 Рік тому
thanks mate for suspenseful tutorial
@freyclante1766
@freyclante1766 Рік тому
I just love that comment about Pineapple as a Pizza topping! Hell No! I couldn't agree more 🙂
@oldpain7625
@oldpain7625 4 місяці тому
"What are some cool cli apps?" "sed and awk"
@EduardoReyesDPM
@EduardoReyesDPM 2 роки тому
Ty
@nobilkwt7222
@nobilkwt7222 2 роки тому
what about a video about chroot
@chessmaster856
@chessmaster856 Рік тому
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????
@AnzanHoshinRoshi
@AnzanHoshinRoshi 2 роки тому
Thank you, Jay.
@tolstoievski4926
@tolstoievski4926 Рік тому
what is the difference between -i and -i.bak ?
@antoineweb1
@antoineweb1 3 місяці тому
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 3 місяці тому
for example: echo "a a" | sed s/a/b/ gives "b a" as output
@noeelreeds
@noeelreeds 29 днів тому
now i can proceed w automations
@nobilkwt7222
@nobilkwt7222 2 роки тому
I want to eat a pizza now 😂🤣😂🤣😂🤣😂🤣😂😂🤣😂🤣🤣🤣
@xrafter
@xrafter 2 роки тому
Pineapple pizza ?
@john-r-edge
@john-r-edge 2 роки тому
Not sure ordinary mortals can master both sed and awk.
@derekfrost8991
@derekfrost8991 2 роки тому
The option i followed by a suffix creates a backup = -i.bak this is important as -i can be dangerous.. :)
@MaximumRD
@MaximumRD 2 роки тому
He sed, She sed......................I'll see myself out......
@voodooyam
@voodooyam 2 роки тому
sed what?
@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??
@terraflops
@terraflops 7 місяців тому
i had issues only because i left out the / after feta (feta/)
@Ranblv
@Ranblv 2 роки тому
I think the s stands for substitute not string
@Blubberland
@Blubberland 11 місяців тому
3:10 instant like
@debeeriz
@debeeriz 2 роки тому
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 2 роки тому
found out how add a g for global quidsup explains it in more detail
@srb1855
@srb1855 Рік тому
👍👍👍
@adammureiko7508
@adammureiko7508 2 роки тому
And what, may I ask, is wrong with Pineapple?
@stevenoderayi5776
@stevenoderayi5776 2 роки тому
‘sed’ is short for ‘stream editor’, for those who’re wondering what the command means.
@markchristophergemzon1052
@markchristophergemzon1052 Рік тому
it was said in the video. thanks anyway.
@strifef7
@strifef7 2 роки тому
rude Jay! Pineapple is the GOAT on pizza!!
@navasr7969
@navasr7969 Рік тому
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
@srsr6099
@srsr6099 2 роки тому
Awesome again. Now I have awk sed & $bash ?
@xrafter
@xrafter 2 роки тому
ّ
@xrafter
@xrafter 2 роки тому
bash: Now: command not found
@srsr6099
@srsr6099 2 роки тому
sudo apt-get update, could help
@sidouglas
@sidouglas Рік тому
video starts at 2:00
@BlindRambler
@BlindRambler 2 роки тому
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.
@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
@subtitles1492
@subtitles1492 2 роки тому
1:22
@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 .
@redshepard5306
@redshepard5306 Рік тому
as a pizza delivery driver who is an aspiring linux user, This tutorial was perfect. that being said, Pineapple_Pizza = "The Best"
@ivanm9186
@ivanm9186 6 місяців тому
CHICKEN PINEAPPLE PIZZA IS THE BEST and PERIOD!
@chessmaster856
@chessmaster856 Рік тому
Is Unix dinosaur or not?
@MRF442
@MRF442 2 роки тому
The pizza example reminded me of a video I saw a long time ago where this guy made a command line Dominos pizza ordering program. ukposts.info/have/v-deo/gmZqZZeDnaGIsWQ.html BTW I love your videos. You are like the Bob Ross of Linux.
@marcravey4621
@marcravey4621 2 роки тому
You have to understand. Unless you can make ordinary devices work, like Bluetooth.. You will always be a third choice. I need to use Bluetooth, and it only stays connected for on average 15 mins. At least printers use the web browser printer settings, else that would be another thing , that doesn't work on any Distro I have used just about every Distro out there, none have lasted for over a year except Linux Mint
@paulojr1384
@paulojr1384 Рік тому
i felt that a can cheat the machine... stupid machine... lol
@poojithapriya2370
@poojithapriya2370 2 роки тому
First
@icyjiub2228
@icyjiub2228 Рік тому
anti pineapple people will always be weak
@hezekiahwatkins
@hezekiahwatkins 3 місяці тому
I regret joining cyber security. I understand none of this shit.
@alexhu98
@alexhu98 2 роки тому
You just lost all credibility for disliking pineapple🤪
Linux Crash Course - awk
16:07
Learn Linux TV
Переглядів 85 тис.
LCL 30 - sed - Linux Command Line tutorial for forensics
23:02
BlueMonkey 4n6
Переглядів 10 тис.
0% Respect Moments 😥
00:27
LE FOOT EN VIDÉO
Переглядів 31 млн
Что будет с кроссовком?
00:35
Аришнев
Переглядів 2,1 млн
Linux Crash Course - The grep Command
14:57
Learn Linux TV
Переглядів 91 тис.
New Linux User: 10 Things I Wish I Knew When I First Started
23:31
Learn Linux TV
Переглядів 354 тис.
5 Common Mistakes New Linux Users Often Make
11:49
Learn Linux TV
Переглядів 100 тис.
How The 'awk' Command Made Me A 10x Engineer
10:40
RobertElderSoftware
Переглядів 162 тис.
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Переглядів 1,2 млн
Learning Awk Is Essential For Linux Users
20:02
DistroTube
Переглядів 278 тис.
Linux Command-Line Tips & Tricks: Over 15 Examples!
31:37
Learn Linux TV
Переглядів 209 тис.
Why Corporate Owned Linux Distributions like Red Hat are a Bad Idea
23:46
Learn Linux TV
Переглядів 142 тис.
ИГРОВОЙ ПК от DEXP за 37 тысяч рублей из DNS
27:53
Ремонтяш
Переглядів 374 тис.
Start from 0 at any point on the T1 Digital Tape Measure
0:14
REEKON Tools
Переглядів 23 млн
All New Atlas | Boston Dynamics
0:40
Boston Dynamics
Переглядів 5 млн