"Transform Text Like a Pro with sed"

  Рет қаралды 1,005

Jake@Linux

Jake@Linux

12 күн бұрын

Covering the unix tool of Sed, the stream editor. In this video I will give 3 examples of how you can use sed to manipulate text on Linux
Gitlab
gitlab.com/jped
Github
github.com/jdpedersen1
Email Me At
jake@jpedmedia.com
My Website
jpedmedia.com
Follow Me On Odysee
odysee.com/$/invite/@Jakeatli...
$100 to test a server through Vultr
www.vultr.com/?ref=9174735-8H
Support
Brave users can support me with BAT on my website or on my youtube channel
patreon
/ jakeatlinux
buy me a coffee
www.buymeacoffee.com/jakeQg

Пікірлер: 18
@binku09
@binku09 10 күн бұрын
HAHAHA THAT THUMBNAIL IS GOLD
@damnhatesyou
@damnhatesyou 10 күн бұрын
Why?
@user-ic1ku9np6h
@user-ic1ku9np6h 8 күн бұрын
yeah, trans text like a pro, literally....
@sadmold
@sadmold 9 күн бұрын
Very useful and clear information. Thank you!
@donaldmickunas8552
@donaldmickunas8552 10 күн бұрын
Jake, The real power, in that third example, was in all of that middle part in the sed command. Those are regular expressions which is a language all it's own. Awk. Sed, and Regular Expressions, when used together effectively, can manipulate large amounts of text quickly. Most computer users today have never heard of these tools mainly because they require some work to learn how to use. Most people aren't willing to put in the work. I think that is a bad decision. I started diving into Regular Expressions about a year ago, using the classic book "Mastering Regular Expressions by Jeffery Friedl", but health issues put a stop to that endeavor. It is time to jump back in. 😉
@dzanful
@dzanful 8 күн бұрын
Your statement that the `-E' flag enables extended regular expressions is true, but can be easily misunderstood. Actually, the only difference between regular and extended regular expressions is that in the latter, special characters like '?', '+' and '()' aren't escaped with a backslash '\' character, otherwise they become literal. So the main purpose of ERE is to make regular expressions more readable and less prone to human error. Consider the following two sed commands, with and without the `-E' flag, both producing the same output: $ echo a b | sed -E 's/(\S+)\s(\S+)/\2 \1/' b a $ echo a b | sed 's/\(\S\+\)\s\(\S\+\)/\2 \1/' b a However, basic regular expressions may be more convenient in some cases: $ echo '(a) (b)' | sed 's/(\w)/(x)/g' (x) (x) $ echo '(a) (b)' | sed -E 's/\(\w\)/(x)/g' (x) (x) Understanding this small difference between BRE and ERE can save a lot of time and confusion when working with sed and grep. But there's so much more sed can do, including flow control, which is rarely if ever mentioned by most content authors on the web.
@anon_y_mousse
@anon_y_mousse 8 күн бұрын
Only recommendations I have is to do a whole word search when replacing simple strings like 'cat'. For instance, if you have a file listing 'Categories of Cats' and you don't do whole word, you'll get 'Dogegories of Dogs'. For whole word, enclose in alligator clips which I can't demonstrate without my post being deleted (not your fault, just KZfaq hates me). Also, if you are deleting based on a potentially mixed case string, if you're using GNU `sed`, then you can use 'Id' instead of just 'd'. Note that's capital eye before the dee. I'm told it's not portable, but who actually uses a different version of `sed` if you're on Linux?
@scottb4029
@scottb4029 6 күн бұрын
Sed and AWK are cool, but not as cool as set. Loved the video. I am worried about you, what is going on with your throat? Btw tea with honey coats the vocal cords.
@replikvltyoutube3727
@replikvltyoutube3727 10 күн бұрын
Slashes Can be actually any symbol IIRC. Since slashes can make problems with escaping and usage in bash scripts, it's better to use some not interpreted symbol like ! or @
@donaldmickunas8552
@donaldmickunas8552 10 күн бұрын
Indeed, by using another symbol rather than the "/" after the "s" will change the delimiter to that symbol.
@donaldmickunas8552
@donaldmickunas8552 10 күн бұрын
Jake, You should do more short videos like this one. No one is teaching this stuff any more. Regular Expressions can be used in many Linux commands. Knowing them can allow the user to accomplish much in a few lines of code. Powerful, heady stuff when applied.
@anon_y_mousse
@anon_y_mousse 8 күн бұрын
I often use a comma because it's easy to type and not generally in any strings I process in that way.
@rato_gordo
@rato_gordo 9 күн бұрын
I'm trying to solve a need while being a noob. I have 37 html files where I want to change the code, e.g. I forgot a alt tag for an image. With sed it is possible to do it in all files at once? I'll definetely read sed man asap ;)
@JakeLinux
@JakeLinux 9 күн бұрын
@@rato_gordo if they are all the same you can run the following: sed -i 's/
@rato_gordo
@rato_gordo 9 күн бұрын
@@JakeLinux thx for the help! I'll look into It and make tests, before losing stuff, lol. As another folk commented here... time to start learning regex. Your videos are really good Jake!
@JakeLinux
@JakeLinux 9 күн бұрын
@@rato_gordo thanks I appreciate that
@edbeckerich3737
@edbeckerich3737 9 күн бұрын
But I have sed NOTHING...and still got a response, silly software
Void Linux Install 2024
48:57
Jake@Linux
Рет қаралды 10 М.
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 49 МЛН
Khó thế mà cũng làm được || How did the police do that? #shorts
01:00
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 31 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 2,9 МЛН
Lets do some shell scripting!
21:18
Jake@Linux
Рет қаралды 2,9 М.
Building a terminal file manager in Bash
25:57
Jake@Linux
Рет қаралды 4,7 М.
Building a Void-src template for Brave
24:51
Jake@Linux
Рет қаралды 1,1 М.
ARRAYLIST VS LINKEDLIST
21:20
Core Dumped
Рет қаралды 53 М.
Why so many distros? The Weird History of Linux
8:23
Fireship
Рет қаралды 1,5 МЛН
hyprland tab-layout
0:30
ivan de
Рет қаралды 1,8 М.
Lite-XL...A Simple Yet Powerful Text Editor
10:46
DistroTube
Рет қаралды 16 М.
Terminal file manager using FZF on linux
11:41
Jake@Linux
Рет қаралды 3,4 М.
Main filter..
0:15
CikoYt
Рет қаралды 15 МЛН
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 216 М.