The Windows command line and the Unix command line are completely different. Knowledge of Windows command line utilities won't help you on Unix and vice versa. On the other hand, there are a lot of commonalities between Unix variants such as Linux and macOS, and knowledge on one will help you with the others.
By coincidence, both Windows and Linux have a utility called find
. But they do completely different things. Your question was originally poorly received here because nobody imagined that you expected a command called find
to search the contents of a file. The Unix find
utility searches for files based on their metadata: name, location, modification time, etc. It doesn't look at the file contents.
The Unix command to search file contents is grep
. Its main focus is to search inside files, but modern versions of grep
can be instructed to automatically traverse directories and search inside all the files in them. To look for files containing the string idle
in the current directory:
grep idle *
The *
character is a wildcard pattern which is expanded by the shell to the list of files in the current directory. This is one of a very few things that works mostly (but not exactly) the same in Windows. Lose the habit of writing *.*
: that excludes files whose name contains a .
(unlike Windows where there's special magic for this pattern for historical reasons). *
does exclude dot files but that's a story for another time. This command doesn't search files in subdirectories; to do that:
grep -r idle .
Here we don't rely on the shell to list files, since grep
will do it on its own.
If you want to look for files on your whole system, you can use
grep -r idle /
but this will search through many system files, so you probably don't want this. See sourcejedi's very good answer on this topic.
If you want to search only for the word “idle”, and not when it's a substring of a word such as “idled” or “sidle”, pass the -w
option to grep
:
grep -w idle *
If you want to search for “idle” in any case (Idle
, IDLE
, iDle
, …), pass -i
:
grep -i idle *
In general, if you're looking for a command to do something, a web search is your best friend. There are ways to search the documentation of a command on your system, but they're typically less effective: you already have to have some idea of what you're looking for. Once you do know the command name, you can look up its documentation with the man
command, for example man grep
or man find
. I recommend reading How do I use man pages to learn how to use commands?. Man pages are often dry summaries that assume that you broadly know what you're doing but have forgotten the details, so don't hesitate to consult other resources.
find
only prints the files that it found. What is your actual problem? Copy-paste the command that you tried, its actual output, and what you expected instead. – Gilles 'SO- stop being evil' Aug 22 '20 at 17:50I am a beginner with Linux so this might just be a dumb question
– Jan Aug 23 '20 at 11:16