0
votes
0answers
49 views

Grep errors after fink installation on Mac OS X 10.9.5

I just installed fink on my Mac. At the end of installation I received the following error message (also including the last several lines above the error): checking how to run the C preprocessor... ...
0
votes
0answers
44 views

I broke grep, and I need it to work in order to configure X11 (XQuartz) to run Wireshark. How can I mend it?

This was an X-post from apple.se, now deleted there, since it hadn't attracted any sufficient help. I need to work with Wireshark for my Web Programming class, so any help will be most appreciated. ...
5
votes
1answer
370 views

How can I perform a second grep on the files returned from a previous grep?

I often find myself searching through a bunch of code using grep in order to pin down what I'm looking for. Sometimes I get a list of files a little longer than I hoped. At this point I want to ...
-2
votes
3answers
204 views

osx bash grep - finding search terms in a large file with one single line

Is there simple unix command line i can enter which lets me isolate say 512 bytes either side of a search term, even if there is only one "line" in a very large text file? Ok, this should be easy. ...
1
vote
2answers
646 views

If, else based on command piped to grep

I can't figure out how to make this (what supposed to be simple) script to work. Basically what I want, to run different stuff based on the state of my Parallels vm, something like this: if [ prlctl ...
1
vote
1answer
54 views

Spotlight search with context?

I'd like to perform searches so that: 1) It can search in the text in a large number of pdf files. Specifically, I want to search within a directory with nested directories several layer deep, and ...
1
vote
1answer
57 views

Grep and What If 75

I'm trying to run the command from What if 75: cat wordlist.txt | perl -pe 's/^(.*)$/\L$& \U$&/g' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' '2223334445556667777888999' | grep -P "(.)\1\1\1\1\1" I ...
0
votes
1answer
40 views

Is it possible to make the “-s” an automatic option on grep?

I'm using Mac 10.9.1. Occasionally in my terminal, I will run grep commands like grep -i -s 'mystring' * Is there a way I can make the "-s" (--no-messages) option, the default whenever i run grep? ...
1
vote
2answers
84 views

How do I search for a string in a group of files when some of those files contain spaces?

I'm running Mac 10.7.5. In a terminal, I'll use this command for finding files with strings find src/main -name "*" | xargs grep -i 'mystring' However when the files contain spaces, I'll get ...
2
votes
0answers
86 views

ag (the_silver_searcher) not searching entire file - does it have an implicit maximum input size?

I have a very large plain text file (multiple gigabytes in size) which I need to search for certain strings. When using grep, I get over 11,000 matches of a string but with ag I get roughly 1,500. The ...
0
votes
3answers
237 views

Write pipe result to variable

I need to be able to write whether the test for a grep is either TRUE or FALSE to a variable so I can use it later For the following, if I run defaults read com.apple.Finder | grep ...
1
vote
1answer
455 views

Is negative look-behind supported in OSX grep?

I'm trying to do something like this: grep -r '(?<!notthis)butthis' ./* And I'm getting no results when some should be returned. Am I missing an escape? Or does OSX just not support regex ...
1
vote
1answer
123 views

Why does this grep filter not work as expected?

Preface: I've added alias airport="sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport" to my .zshrc. myuser:~/ $ airport prefs ...
0
votes
1answer
2k views

Using Mac OS X terminal to copy a selection of folders to a new location, with merge behavior

I have a folder 'foo' that contains a lot of sub folders, e.g. foo |---20101 |---20102 |---20103 |---20111 |---20112 |---20113 There are way more than this, but hopefully it explains the ...
0
votes
3answers
113 views

Grep for This and NOT That in a File?

How can I grep for files in a directory structure that have this text addDesignControlChangeNotification but are missing this text removeDesignControlChangeNotification Thanks! Note: I mean the ...
0
votes
4answers
118 views

Simple script parsing text, what is wrong here?

I'm a big user of https://www.grc.com/passwords.htm to get strong passwords. However, having to go to the site and manually copy the password every time gets old fast, so I decided to do a little ...
4
votes
2answers
2k views

Grep in Mac OS X's terminal — only displaying one color

I am used to grep being able to color the filename, the line number, and the match itself. These three ought to be different colors. This works flawlessly on a Linux terminal and even MinGW on ...
7
votes
1answer
4k views

How can I grep with color in Mac OS X's terminal?

I recently found that on Mac OS X I can set this up in my shell ~/.profile so that when I use grep it will print the matches in color (white one red). alias grep='GREP_COLOR="1;37;41" LANG=C grep ...
2
votes
1answer
305 views

Bash script with grep -w

I am using the following command: x.txt | grep -w 'in' and I am getting answers like: in into ... etc. I only want the answer: in How should i modify the command?
1
vote
3answers
168 views

Grep-like tool for all filetypes?

Is there a grep/ack/grin-like tool for all filetypes (including MS Office, PDF, etc)? I frequently find myself wanting to search a folder or an entire disk for strings inside files that are more than ...
2
votes
1answer
352 views

grep segfaults when passed “-r” and “--exclude-dir” and stdin is a pipe

If I pipe data into grep AND pass the "-r" flag (recurse subdirs) AND pass the "--exclude-dir" flag (e.g. to skip ".git" directories), then it segfaults. If any one of these things is missing, then ...
0
votes
2answers
3k views

Searching File Contents of Remote Server via FTP

I'm running OSX 10.7 and i'm looking for a way to search for a string in the contents of a file on a remote FTP server. I'd like to be able to run the search over ftp rather than having to download ...
0
votes
3answers
876 views

Mac OS X Terminal: Search output of another command with grep

I am trying to get the output of an ls command and search that list for a regex expression... Effectively, it will search every file name in the folder for the regex expression. I put together a ...
1
vote
1answer
748 views

Is there a command in Mac OS X that can perform multiline regex searching?

I want to do a simple regex search recursively through a directory that isn't restricted to single lines. I tried grep and ack, but neither seem to support this. I know it shouldn't be too ...
4
votes
3answers
4k views

How can I find all files in a folder with a certain text string and an extension?

I am using OS X. I need to find files in a directory with the .php extension and the string 41 somewhere in the file's contents. I tried using grep. grep -R 41 *.php This however only seemed to ...
0
votes
0answers
187 views

What's a good find / replace utility for Mac OS X? [duplicate]

Possible Duplicate: Mac OS X search and replace tool with regular expression support I'm looking for a utility to do some multi-line find / replace with a GUI interface, possibly with some ...
0
votes
2answers
893 views

How can I make grep use CRLF (and not LF) as a newline?

I need to grep through a file where not only are lines terminated by a CRLF, but they might also have several LFs on each line. How can I make grep ignore LFs unless there's a CR in front of them? ...
3
votes
4answers
907 views

grep not functioning correctly

I've been happily using grep for many years without any issues, but since today it quit working. During the past hour I tried this and that, but enough is enough, I'm posting the bastard here: On the ...
1
vote
1answer
575 views

grep -v -A not working properly (actually not working at all)

I have to filter lines like the following: [javac] /Users/looris/Sviluppo/android/projects/toutry/src/net/looris/toutry/Stuff.java:23: warning: unmappable character for encoding ascii [javac] ...
6
votes
4answers
8k views

Mac OS X search and replace tool with regular expression support

I'm looking for a regular expression based search/replace GUI tool that is able to handle multiple files/subdirectories, something like grepWin but for Mac OS X. PS. I'm aware of grep and I don't ...
2
votes
3answers
1k views

Recovering text files in terminal using grep on Mac OS X Snow Leopard

I foolishly removed some source code from my Mac OS X Snow Leopard machine with rm -rf when doing something with buildout. I want to try and recover these files again. I haven't touched the system ...
9
votes
9answers
6k views

grep all .java files in a directory for a particular string

How would I search all .java files for a simple string (not a regex) in the current directory and all sub-directories on Mac OS X? I just want to print a list of file and directory names that match.