> For the complete documentation index, see [llms.txt](https://d3ndr1t30x.gitbook.io/breaking-things-a-junior-pentesters-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://d3ndr1t30x.gitbook.io/breaking-things-a-junior-pentesters-guide/enumeration/extracting-magic-bytes-from-a-file.md).

# Extracting magic bytes from a file

### Using the head command

```
head /var/lib/inetsim/http/fakefiles/sample.jpg | xxd
```

### Using the head command & piping for a specific number of bytes

```
head -c 16 /var/lib/inetsim/http/fakefiles/sample.jpg | xxd
```
