##########################
## Finding Files (find, locate)
##########################

## LOCATE ##
# updating the locate db
sudo updatedb

# displaying statistics
locate -S

# finding file by name
locate filename # => filename is expanded to *filename*
locate -i filename # => the filename is case insensitive
locate -b '\filename' # => finding by exact name

# finding using the basename
locate -b filename

# finding using regular expressions
locate -r 'regex'

# checking that the file exists
locate -e filename

# showing command path
which command
which -a command


## FIND ##
find PATH OPTIONS

# Example: find ~ -type f -size +1M # => finding all files in ~ bigger than 1 MB

## Options:
# -type f, d, l, s, p
# -name filename
# -iname filename # => case-insensitive
# -size n, +n, -n
# -perm permissions
# -links n, +n, -n
# -atime n, -mtime n, ctime n
# -user owner
# -group group_owner