> For the complete documentation index, see [llms.txt](https://fastiraz.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fastiraz.gitbook.io/doc/ctf-tips/useful-commands.md).

# Useful Commands

## Instant find flags

```bash
find / -name "user.txt" -exec cat {} \; 2>/dev/null
find / -name "root.txt" -exec cat {} \; 2>/dev/null
```

## Find string in each file from path

```bash
find / -type f -exec grep -iH 'string' {} \; # `-E` for regex
```

## Find hosts without nmap

```bash
for i in {1..254} ;do (ping -c 1 192.168.1.$i | grep "bytes from" &) ;done
```

{% embed url="<https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcHpqbDVpcDVnc3gwN281NTFqMXlvNnA3OTNrc242cXV3bGs1YTk0ayZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l2Je0ZdFV02q7wncc/giphy.gif>" %}
