Results for “find”
Small, practical examples. Search by task or narrow things down below.
Find what remains after division
C++: Use the remainder operator to count items left after forming complete groups.
C++✓ Tested
Find what remains after division
C: Use the remainder operator to count items left after forming complete groups.
C✓ Tested
Exclude a directory from a recursive search
Linux Commands: Use prune to avoid descending into generated dependencies.
Linux Commands✓ Tested
Extract a filename from a path
Linux Commands: Use basename with an explicit suffix when removing a known extension.
Linux Commands✓ Tested
Extract a parent directory from a path
Linux Commands: Use dirname without needing the path to exist.
Linux Commands✓ Tested
Limit a search to the immediate directory
Linux Commands: Use maxdepth with type f to exclude nested files and directories.
Linux Commands✓ Tested
Match filenames without case sensitivity
Linux Commands: Use iname for a case-insensitive filename pattern.
Linux Commands✓ Tested
Normalize a path without requiring it to exist
Linux Commands: Use GNU realpath -m and relative-to to normalize dot segments.
Linux Commands✓ Tested
Pass filenames with spaces through xargs
Linux Commands: Use null delimiters end to end instead of splitting filenames on whitespace.
Linux Commands✓ Tested
Run a command safely for each matching file
Linux Commands: Use find -exec with argument placeholders so spaces in filenames remain intact.
Linux Commands✓ Tested
Search the stream for a message marker
Arduino / C: find consumes input through a matching marker or until timeout.
Arduino / C✓ Tested
Archive filenames safely with null delimiters
Linux Commands: Use find -print0 with tar --null to preserve spaces and embedded newlines in filenames.
Linux Commands✓ Tested