find

The find command is handy tool to manage files inside the file system, the command structure is:

find dir criteria [action]

Where:

In order to limit the depth level of the search the -maxdepth option can be used

find dir -maxdepth <VALUE> criteria [action]

Oneliners

find . -maxdepth 1 -type f  -exec rm -i {} \;
find . -not -regex 'REGEX'
find . -name 'REGEX'
Table of Contents