Post thumbnail of Print a range of lines from a file using sed
18 January 2011
Continue reading Print a range of lines from a file using sed

Print a range of lines from a file using sed

If you want to select a range of lines from a file, look no farther than your handy ’sed’ utility. It is by definition, the perfect tool for the job!

Post thumbnail of The most useful and complete sed tutorial
9 August 2010
Continue reading The most useful and complete sed tutorial

The most useful and complete sed tutorial

Everything you ever wanted to know about the stream editor sed. Pattern matching, delimiters, deletion, ranges, grouping, all explained.

Post thumbnail of Two ways to change case lowercase to uppercase using sed
22 June 2010
Continue reading Two ways to change case lowercase to uppercase using sed

Two ways to change case lowercase to uppercase using sed

Change lowercase to uppercase or vice versa using sed the brute force easy way and the smart way. One use of this would be finding the hardware address of an interface and converting it to all uppercase.

Post thumbnail of Using dd to search for strings in memory or devices
6 May 2009
Continue reading Using dd to search for strings in memory or devices

Using dd to search for strings in memory or devices

The problem is, hexdump will give you 16 ascii characters surrounded by pipes and then a newline before printing the next 16. You can’t search for long strings that way…

Post thumbnail of Removing blank lines from text files automatically or interactively
10 February 2009
Continue reading Removing blank lines from text files automatically or interactively

Removing blank lines from text files automatically or interactively

Using sed’s delete, you can specify the start and beginning using the carot and dollar sign with nothing in between. You could replace this with something else using a search ’s/^$/stuff/g or just delete it like this:

Post thumbnail of Grep IP addresses from ifconfig
5 February 2009
Continue reading Grep IP addresses from ifconfig

Grep IP addresses from ifconfig

Here’s a bunch of ways to get the ip addresses for all your network interfaces using ifconfig.

Powered by Wordpress   |   Lunated designed by ZenVerse