Skip to content

Files

Latest commit

 

History

History
34 lines (20 loc) · 753 Bytes

SC2185.md

File metadata and controls

34 lines (20 loc) · 753 Bytes

Pattern: Use of find without search path

Issue: -

Description

When not provided a search path, GNU and Busybox find will use a default path of ., the current directory.

On POSIX, macOS/OSX, FreeBSD, OpenBSD and NetBSD, it will instead result in an error.

Explicitly specifying a path works across all implementations, and is therefore preferred.

Example of incorrect code:

find -type f

Example of correct code:

find . -type f

Exceptions

You will get a false positive if you concatenate a series of pre-path flags:

find -XLE .

In such cases, please either use find -X -L -E . or ignore the message.

Further Reading