# Find Command Cheatsheet

## Find file by name <a href="#find-things-by-name" id="find-things-by-name"></a>

```
find /path/to/search -name filename
```

## Find file by name (case-insensitive) <a href="#find-things-by-name-case-insensitive" id="find-things-by-name-case-insensitive"></a>

```
find /path/to/search -iname filename
```

## Find only files by name <a href="#find-only-files-by-name" id="find-only-files-by-name"></a>

```
find /path/to/search -name filename -type f
```

> must notice that " " quotes, you must use it if you want to use wildcards otherwise it will not find,\
> and also **f** in type stand for file

## Find only directories by name <a href="#find-only-directories-by-name" id="find-only-directories-by-name"></a>

```
find /path/to/search -name dirname -type d
```

## Find file with insecure permission <a href="#find-file-with-insecure-permission" id="find-file-with-insecure-permission"></a>

```
find / -writable -type d 2>/dev/null
```

## Find all symlinks <a href="#find-all-symlinks" id="find-all-symlinks"></a>

```
find /path/to/search -type l
```

## Find things by it's owner <a href="#find-things-by-its-owner" id="find-things-by-its-owner"></a>

```
find /path/to/search -user owner
```

## Find executable files <a href="#find-executable-files" id="find-executable-files"></a>

```
find /path/to/search -type f -executable
```

## Find SUID files <a href="#find-suid-files" id="find-suid-files"></a>

```
find /path/to/search -perm -4000
```

## Find things changed in the last 24 hours <a href="#find-things-changed-in-the-last-24-hours" id="find-things-changed-in-the-last-24-hours"></a>

```
find /path/to/search -ctime -1
```

## Find files bigger than X Size <a href="#find-files-bigger-than-x-size" id="find-files-bigger-than-x-size"></a>

```
find /path/to/search -size +<size>

$ find ~ -size +5000M
```
