This will select lines that begin with the `c` tag and print them out after removing the tag. lsof -F c somefile | sed -n '/^c/s/^c//p'