Removing empty lines from text/csv file with awk in linux

Problem

You have a text file that has empty lines, and you would like to remove them.

Solution

You can use awk in linux like the following to create a new file with the empty lines removed:

Get the process id for specific applications in linux

Problem

You would like to know the processes ids for certain program/keyword etc, in linux.

Solution

Use the following to get a list of the processes ids replacing ruby with the keyword that you are looking for: