MIAP Digital Literacy Command Line Guide

Learn about BASH commands!

View on GitHub

The find command

Summary

The find finds files. By default, it outputs their path relative to where you ran find. But, in addition of providing you with advanced “filters” it actually allows you to run commands on each of those files.

Basic command structure

For all descriptions below, the dollar sign indicates that BASH command prompt.

$ find [path] [options] [expression]

Path: Where to start searching (e.g., ~/Documents).

Options: Refine your search (e.g., -type for files/directories).

Expression: Criteria like filenames or sizes.

Possible Flags

-name "FILENAME"

Finds files or directories matching FILENAME (case-sensitive)

-iname "FILENAME"

Similar to -name, but case-insensitive

-type TYPE

Finds files of a certain type (options below)

f: Regular file

d: Directory

l: Symbolic link

Output

The find command has many different kinds of options as described below:

Examples

Go back to the main list of commands