English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to find all the files in the current directory that contain the expression 'WhichFilesAmIIn'. How do I do this if I need to use Linux?
I know the 'find' command can be used to find files but, as far as I know, I can only give some expressions for the file names and not what's inside.

2006-11-06 23:48:12 · 4 answers · asked by zolleymokus 1 in Computers & Internet Other - Computers

4 answers

dude, I want to know this too. It's been annoying me for ages. Will hang around...

... ok if the Penguin says it, it must be true. I vote for that guy.

2006-11-06 23:50:46 · answer #1 · answered by wild_eep 6 · 0 0

The command you want is grep. Use it like this:
grep -r WhichFilesAmIIn *
From the directory you want to start looking and it will tell you the file name and show you the line that the term is in.
This will only work with text based files. Binary files is much more difficult to do.

2006-11-07 00:11:06 · answer #2 · answered by John K 4 · 1 0

to view contents of files in current directory use the command "cat"
the syntax would be
cat (file name)

2006-11-07 00:10:57 · answer #3 · answered by ajk1139 2 · 0 0

simple !!

grep keyword *

or

cat * | grep keyword

2006-11-07 00:12:58 · answer #4 · answered by Jadoo_Dost 2 · 0 0

fedest.com, questions and answers