Bash and Linux 5 · Searching and text
Run a command on a list of files
Pass matching file names to another command.
find . -name "*.tmp" -print0 | xargs -0 rm
Caution: Runs rm on every match. Replace rm with ls first to check the list.
Official Bash and Linux 5 documentation
More searching and text commands
- Search file contents
- Find files by name
- Find files changed recently
- Count lines
- Count duplicate lines
- Replace text in a file
All searching and text commands · Bash and Linux 5 cheatsheet