perl -ne "(split)[1] || print" temp.txt #same thing... perl -ne "print if !((split)[1]);" temp.txt