> For the complete documentation index, see [llms.txt](https://ret2basic.gitbook.io/ctfnote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ret2basic.gitbook.io/ctfnote/computer-science/linux/dev-null.md).

# /dev/null

## What is `/dev/null`?

To begin, `/dev/null` is a special file called the **null device** in Unix systems. Colloquially it is also called the **bit-bucket** or the **blackhole** because it immediately discards anything written to it and only returns an end-of-file `EOF` when read.

## Examples

Search for SUID binaries and discard error messages:

```bash
find / -perm -u=s -type f 2>/dev/null
```

Supress any output (both stdout and stderr) from the command:

```bash
<command> > /dev/null 2>&1
```

## Reference

{% embed url="<https://medium.com/@codenameyau/step-by-step-breakdown-of-dev-null-a0f516f53158>" %}
Step by step breakdown of /dev/null
{% endembed %}
