I love BASH but am struggling with GREP.
My goal is simple: GREP my Desktop files for “0.jpg”.
MY BASH CODE:
$ pwd /Users/jennalusche/Desktop $ grep "0" *.jpg
Binary file IMG_2125.jpg matches Binary file the-letter-just-j-bw-vectorized-v2.jpg matches
Mac OS X Yosemite
Why is GREP “0” *.jpg showing BINARY FILES rather than a SINGLE FILE named “0.jpg”?
MY DEBUGGING RATIONALE
I’m assuming the reason these files are showing up is due to the fact that they are both “Binary.” “Binary File” = the file is coded in 0’s & 1’s. Thus, both files showing up must translate as 0’s, while all the other files in my PWD translate as 1’s.
MY OBVIOUS QUESTION —
Why isn’t 0.jpg the output?
I’m assuming both the output files, in binary terms, are 0’s and all other files in the PWD are 1’s. Is this assumption correct?
GOING DOWN THE RABBIT HOLE —
Why are the resulting files 0’s? I didn’t code these files in any special way on purpose. Are the files that didn’t show up from my GREP search coded as 1’s? If so, why?
TUMBLING DOWN DEEPER RABBIT HOLE — GREP. SED. AWK. LS. CAT. ECHO. FIND.
Obviously there is a lot of overlap in the functionality of each of these utilities.
What’s your favorite combination, in terms of usage?