1
vote
2answers
121 views

Search and replace full line in recursive files

I'm using: grep -n -H -o -R -e textword . List all file recursively under directory '.' with string 'textword' and show the file, line and only portion matching. I need to remove lines that ...
0
votes
1answer
242 views

PHP file recursive change array key on find [closed]

I used PHP array $lang['module']['1'] = 'Title'; $lang['module']['2'] = 'Title2'; $lang['value'] = 'text123'; how i can use replace in terminal Key Value to CASE UPPER ? $lang['VALUE'] ...
5
votes
2answers
2k views

Where does grep -r search by default?

I found if I search using grep without specifying a path, like grep -r 'mytext' it takes infinitely long. Meanwhile if I search with path specified grep -r 'mytext' . it instantly finds what I need. ...
0
votes
2answers
2k views

How to search all subdirectories and their subdirectories for the occurence of a word using grep? [duplicate]

Possible Duplicate: Searching for string in files Suppose I have a directory called Home and it is my current directory. And in this home directory I have many other directories ...
1
vote
1answer
2k views

How to grep a text recursively on BusyBox 1.0?

How can I find a file containing a certain string on a BusyBox 1.0, if grep -r does not work?
6
votes
3answers
5k views

How can I find all files that do NOT contain a text string?

What concise command can I use to find all files that do NOT contain a text string? I tried this (using -v to invert grep's parameters) with no luck: find . -exec grep -v -l shared.php {} \; ...
4
votes
6answers
4k views

Recursive search doesn't work for grep on solaris

On out Solaris server I'm finding that grep -r doesn't work, which is the usual way that I used grep. It seems that egrep is the same. Given that I have no control over the machine, is there a way to ...
3
votes
2answers
5k views

Search string in many files on HP-UX

I need to find which files (they can have space in the filename) of a directory contains a string using only sh and system's commands (Perl is not an option). For a few files, this command works ...
19
votes
3answers
15k views

How to search text throughout entire file system?

Assuming that the grep tool should be used, I'd like to search for the text string "800x600" throughout the entire file system. I tried: grep -r 800x600 / but it doesn't work. What I believe my ...
2
votes
2answers
242 views

Searching for string in files

Is there an easy way to search inside 1000s of files in a complex directory structure to find files which contain a specific string within the file?
5
votes
4answers
3k views

Find a string only in a specific file inside subdirectories

Let's say I need to find the function GetTypes() in all C# source file (.cs) the directories/subdirectories. I used grep -rn GetTypes *.cs, but I got an error with grep: *.cs: No such file or ...
8
votes
4answers
5k views

Finding a substring in files across subdirectories with a single built-in command?

In Windows, if I wanted to find a string across all files in all subdirectories, I would do something like findstr /C:"the string" /S *.h However, in Linux (say, Ubuntu) I have found no other way ...