Linux 4 All

Best Linux tricks source

Posts in the sed category

Get mail queue

When dealing with mail issues, the following one-liner will display all Postfix mail IDs from the queue.

postqueue -p | egrep -v ^[[:space:]] | grep -v ^$ | awk '{print $1}' | grep -v ^\( | grep -v ^\- | sed -e 's/\*//g'

Strip html tags

  • In Linux
  • On 10 Nov | '2014

The following sed command will strip out html tags from a file. That’s useful to us with curl to get a nice output on the screen.

sed 's|<[^>]*>||g'