
Learning Sed Is Beneficial For Linux Users DistroTube
video description
Date: 2022-03-30
Related videos
Comments and reviews: 10
Eydamos
I recently saw your awk video and now this sed video. Both are really great and I have learned a lot. Just one thing I want to point out as I had this issue just this week:
If you have a big file e.g. let's say 3Gb log file and want to have 1000 line starting at line 30000 sed is a lot quicker then awk with this.
In my test -sed -n '30000,31000p' file.log- took like 3 seconds while -awk 'NR==30000,NR==31000 -print $0-' file.log' took almost a minute
reply
I recently saw your awk video and now this sed video. Both are really great and I have learned a lot. Just one thing I want to point out as I had this issue just this week:
If you have a big file e.g. let's say 3Gb log file and want to have 1000 line starting at line 30000 sed is a lot quicker then awk with this.
In my test -sed -n '30000,31000p' file.log- took like 3 seconds while -awk 'NR==30000,NR==31000 -print $0-' file.log' took almost a minute
reply
voytechj
When creating sed regex expression it's a good idea to check what has been modified:
$ sed '...' inputfile - diff inputfile
you can pipe it further to a program that colorizes text:
$ sed '...' inputfile - diff inputfile - bat -l diff
For vim users you can use vimdiff (easier side by side comparison), but -process substitution- has to be used to trick vim that pipe is a file:
$ vimdiff inputfile
reply
When creating sed regex expression it's a good idea to check what has been modified:
$ sed '...' inputfile - diff inputfile
you can pipe it further to a program that colorizes text:
$ sed '...' inputfile - diff inputfile - bat -l diff
For vim users you can use vimdiff (easier side by side comparison), but -process substitution- has to be used to trick vim that pipe is a file:
$ vimdiff inputfile
reply
Shoo
im sorry, but i cant read anything, im in my 50s and your terminal size is so small compared to your other videos ... not everybody has a 65 inch monitor, some are sitting in front of a 14 laptop, plz change this in your future videos, im kinda angry as this was very interesting to me, but its only an audio possibility for me, no thumb down given, only this constructive critic :(
reply
im sorry, but i cant read anything, im in my 50s and your terminal size is so small compared to your other videos ... not everybody has a 65 inch monitor, some are sitting in front of a 14 laptop, plz change this in your future videos, im kinda angry as this was very interesting to me, but its only an audio possibility for me, no thumb down given, only this constructive critic :(
reply
Shutdown
More useful CLI commands -- Search for fzf. -Why you should be using fzf, the command line fuzzy finder- -- Pure command line CLI with NO file managers .
Example .. ls - fzf -m
Also checkout.. --- -Why I fell in Love with GNU Emacs- and --- -Pro Linux users don't need file managers-
reply
More useful CLI commands -- Search for fzf. -Why you should be using fzf, the command line fuzzy finder- -- Pure command line CLI with NO file managers .
Example .. ls - fzf -m
Also checkout.. --- -Why I fell in Love with GNU Emacs- and --- -Pro Linux users don't need file managers-
reply
Hernan
I actually think that the space search pattern is not optimised, it is way better to use a '+' since it will only act when it is 1 or more instead of 0 or more. With '-', the command will make an action every single line, that's unefficient.
reply
I actually think that the space search pattern is not optimised, it is way better to use a '+' since it will only act when it is 1 or more instead of 0 or more. With '-', the command will make an action every single line, that's unefficient.
reply
kain
Hello dt , i know this may be far fetched but is there a chance you can make an iso of your arch with all the theming and text editors (emacs) and terminal configuration settings for your viewers. I really appreciate your arch setup.
reply
Hello dt , i know this may be far fetched but is there a chance you can make an iso of your arch with all the theming and text editors (emacs) and terminal configuration settings for your viewers. I really appreciate your arch setup.
reply
1000100
I want to add this sed, I use this to edit my host file. This will essentially add a line of text after the first match pattern. For example ==== sed -i '0,/pattern/!b;//a[the text u want to add]' filename
reply
I want to add this sed, I use this to edit my host file. This will essentially add a line of text after the first match pattern. For example ==== sed -i '0,/pattern/!b;//a[the text u want to add]' filename
reply
bigpod
if you ask me if you are doing a lot of bash scripting yes sed is usefull but if you are like me and tend to go for other -proper- programming languages like python or c# not sure sed is verry usefull
reply
if you ask me if you are doing a lot of bash scripting yes sed is usefull but if you are like me and tend to go for other -proper- programming languages like python or c# not sure sed is verry usefull
reply
TheSulross
when -i option was added to sed, that was life changing - and that can use -e to specify multiple expressions to apply on the stream - sed is kind of like the single most potent unixy power tool
reply
when -i option was added to sed, that was life changing - and that can use -e to specify multiple expressions to apply on the stream - sed is kind of like the single most potent unixy power tool
reply
Matthew
'Pro' tip: most shells will clear the screen when you hit CTRL-L :)
[edit] Oh, and CTRl-A and CTRL-E will take you to the beginning/end of the line (i.e. Emacs navigation commands).
reply
'Pro' tip: most shells will clear the screen when you hit CTRL-L :)
[edit] Oh, and CTRl-A and CTRL-E will take you to the beginning/end of the line (i.e. Emacs navigation commands).
reply
Add a review, comment















