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: 
You can use **grep** for this purpose.

Try: `grep -v ^$ filename`.

---

Your command also seems to work:

```
$ cat t
123
123
123
123

123

123
$ sed '/^$/d' t
123
123
123
123
123
123
$ sed '/^$/d' t >tt
$ cat tt
123
123
123
123
123
123
$

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

```
grep -vE "$^" yourfile

```