> For the complete documentation index, see [llms.txt](https://til.devjugal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.devjugal.com/linux/grep/remove-empty-lines.md).

# Remove Empty Lines

We can remove empty lines from the output using `grep` in following ways -

## Option 1

```bash
grep -v '^[[:space:]]*$' {FILE}
```

## Option 2

```bash
grep . {FILE}
```

This can be used to make things simple, and easy if Windows line-endings aren't concerned.

***Source:*** [***StackOverFlow***](https://stackoverflow.com/a/3432574)
