Manipulating text with sed

The sed utility can be used to print the contents of a file, substitute a line (or multiple lines), and then save the file. In contrast to grep, sed can substitute a line or multiple lines in a file and perform an in-place update of that file.

The simplest sed invocation when substituting foo for bar is:

$ sed 's/foo/bar/' inputfile
Continue reading “Manipulating text with sed”

bash Tips and Tricks

I call these tips and tricks – “bash kung-fu”. You can save a lot of typing with these handy bash features.

bash, or the Bourne again shell, is the default shell in most Linux distributions. It has many features to enhance user-friendliness and productivity. Unfortunately, you can’t take advantage of those features unless you know they exist. So here are some bash tips and tricks that will help you with your everyday system admin tasks.
Continue reading “bash Tips and Tricks”