Software⏱️ 2 min read📅 2026-05-31

How to Fix: Problem running find: missing argument to `-exec'

find command missing argument to -exec, incorrect usage, fix

Quick Answer: Use the `-type f` option with `grep` instead of `-exec` for a more efficient and correct search

You are getting this error because the `-exec` option in `find` requires a command that takes one or more arguments. In your case, you want to use `grep`, which is a command that operates on files and requires an argument (the pattern to search for). The solution is to use the `-type f` option with `find` to specify that you only want to operate on files, and then pipe the output of `find` to `grep

🛠️ Step-by-Step Verified Fixes

Method 1: Using find with -type f and piping to grep

  1. Step 1: Run `find . -type f -exec grep chrome {} "

Method 2: Using find with -print0 and piping to xargs

  1. Step 1: Run `find . -print0 | xargs -I {} grep chrome {}`

🎯 Final Words

By following these steps, you should be able to find files in the current directory that contain the text 'chrome' using `find` and `grep'. Remember to always use the correct options and syntax when working with command-line tools.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions