This is a great set of tutorials, he also wrote one about Awk: http://www.grymoire.com/Unix/Awk.html
Get to know these two tools and you'll be amazed at the hours you can save and what you can do, especially with text files.
This is a great set of tutorials, he also wrote one about Awk: http://www.grymoire.com/Unix/Awk.html
Get to know these two tools and you'll be amazed at the hours you can save and what you can do, especially with text files.
It's obviously much slower - but I've never been in a position where I needed insane speed to quickly fix a bunch of files.
When you say you store common idioms in your Bash profile, do you mean storing the commands as Bash aliases or functions? I have similar issues with remembering syntax and building sed commands and I've been trying to do something similar to avoid spending time building a complex command from scratch when I already created a similar one some time previously.
sudo ngrep -W byline -d en6 -qilw 'get|post' tcp dst port
so `watchport 8080` will print all network traffic over port 8080 on my ethernet. I actually rarely use this as 'watch_port' directly, but it helps me remember quickly how to bend ngrep to my needs.
For a long time, I didn’t like using aliases because I didn’t want to become overly reliant on my custom aliases – and then miss them when working on an unfamiliar system. This generally worked out alright when I was able to use `Ctrl-R` with a large Bash history. Now, I think that was an irrational rationale and that aliases are very useful shell features. I’m currently trying to organise my aliases and functions into useful groups such as `home_aliases.sh`, `cygwin_aliases.sh`, etc. so that they can be loaded as needed. I then plan on adding them to a git repository so that they can easily be used – and updated – on different systems.
BTW, thanks for letting me know about ngrep. It looks like a useful complement to tcpdump.
sed is bullshit.
Do you know it is not actually possible to get output from sed that does not contain a newline?
:%!sed …