Question: I need to remove empty new lines from text file in terminal.

Example file

```
123
123
123
123

123

123

```

I've searched in google a bit but only solution found was `sed '/^$/d' myFile > tt` and it does not help. I still got these empty new lines.

Answer: 
**Using AWK:** NF is AWK's in-built variable that stores the number of fields in each record. When used by it self, it will print only those lines where NF!=0. 

```
[jaypal~/Temp]$ cat t
123
123
123
123

123

123

[jaypal~/Temp]$ awk 'NF' t
123
123
123
123
123
123

```
There's probably a 100 ways to do this, this is one:

```
grep -vE "$^" yourfile

```