I want to use the find command to find all files on the system that have the word fsck.

I tried

find / -iname fsck

and it started to search files but everything was permission denied. When I try executing with sudo the command line just seems to hang.

Am I on the right track here? I am really stumped as to how to do this..

  • If the files contain the word, then what you want is grep -R, but even so, you should exclude: /proc, /sys, /run from the search. – muru Feb 25 '15 at 22:18
  • There are always a lot of "permission denied" outputs cluttering the results. What I usually do is to follow the command with 2>/dev/null, which causes them to be ignored. For example, find / -iname '*fsck*' 2>/dev/null – Marty Fried Feb 26 '15 at 3:32

Just to make sure it was a typo, I see your command has fckd instead of fsck.

Typically how I would do it is:

find / -iname '*fsck*'

I wouldn't be surprised if the command took quite a while to complete but it should show results as it sees them.

The main thing is, you need the pattern to be a glob like you'd use with 'ls'.

Putting the pattern in single quotes makes it so that your shell doesn't try to expand *fsck* into a list of matching files in your current directory prior to running the find command. For example, if you had no files that matched *fsck* in your current directory the command run would end up being:

find / -iname

Or if you had 3 files [ fsck.a fsck.b fsck.c ] in your current directory the command run would end up being

find / -iname fsck.a fsck.b fsck.c

By escaping or quoting the *fsck* the command ends up as you would expect it:

find / -iname *fsck*

I believe you can also escape the *'s with \*fsck\*.

Hope that helps.


Or, for text within files as muru pointed out, but I d̶o̶n̶'̶t̶ didn't (thanks) have reputation points to followup.

grep -sinIR fsck * for globaly search regular expression and print --supressing errors, ignoring case, returning line numbers, Ignore binary files, and do it Recursively, * all files in the directory

As sparhawk pointed out locate is a handy tool. locate -i nAmE to ignore case, -A for mutiple search terms, e.g., locate -iA fsck txt which will return all files inclusive of fsck and txt in the name with an updated database.


To find files that contain fsck, you need to use wildcards.

find / -iname '*fsck*'

You are correct that sudo is required. It was "hanging" because it needs to traverse your entire file system, which takes a long time. Alternatively, I'd recommend using locate, which uses a pre-compiled index, and is hence much quicker. This index is usually updated regularly by a cronjob, but you can ensure that it is up to date with

sudo updatedb

Then you can search for your file with

sudo locate fsck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.