Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ The commands we're going to talk about all output their results as text. When y
Stijn Debrouwere
/files$

Notice that after it prints out its output, it goes back to giving you a fresh prompt. Getting the output printed out to you in this fashion is useful if you're just poking around, but often you want to do one of two things: **send the output to a file**, or **send the output to another command as an input**.
Notice that after it prints out its output, it goes back to giving you a fresh prompt. Getting the output printed out to you
in this fashion is useful if you're just poking around, but often you want to do one of two things:
**send the output to a file**, or **send the output to another command as an input**.

### Sending the output to a file

Expand Down
141 changes: 85 additions & 56 deletions solution.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,92 @@
```zsh
# Clone the initial repository
git clone [email protected]:eerwitt/command-line-mystery.git
cd command-line-mystery
grep CLUE ./crimescene:
the local coffee shop person said that.. a women left right before they heard the shots. The name on her latte was Annabel,
she had blond spiky hair and a New Zealand accent.

# Check the status to see if anything is already marked as new (shouldn't be)
git status
grep Annabel ./people
Annabel Sun F 26 Hart Place, line 40
Oluwasegun Annabel M 37 Mattapan Street, line 173
Annabel Church F 38 Buckingham Place, line 179
Annabel Fuglsang M 40 Haley Street, line 176

# Edit my solution file
subl solution.md
clue 5:
interviews $ cat interview-699607
Interviewed Ms. Church at 2:04 pm. Witness stated that she did not see anyone she could identify as the shooter,
that she ran away as soon as the shots were fired.
However, she reports seeing the car that fled the scene. Describes it as a blue Honda, with a license plate that
starts with "L337" and ends with "9"

# Commit initial solution
git add solution.md
git commit -a
grep L337* ./vehicles

License Plate L337ZR9
License Plate L337P89
License Plate L337GX9
License Plate L337QE9
License Plate L337GB9
License Plate L337OI9
License Plate L337X19
License Plate L337539
License Plate L3373U9
License Plate L337369
License Plate L337DV9
License Plate L3375A9
License Plate L337WR9

# Start reading the instructions
less instructions
clue 6: vi vehicles
:/license plate number

# Check for clues in the mystery
cd mystery
grep CLUE ./crimescene
License Plate L337QE9
Make: Honda
Color: Blue
Owner: Erika Owens
Height: 6'5"
Weight: 220 lbs

License Plate L337539
Make: Honda
Color: Blue
Owner: Aron Pilhofer
Height: 5'3"
Weight: 198 lbs

License Plate L337369
Make: Honda
Color: Blue
Owner: Heather Billings
Height: 5'2"
Weight: 244 lbs

License Plate L337DV9
Make: Honda
Color: Blue
Owner: Joe Germuska
Height: 6'2"
Weight: 164 lbs

License Plate L3375A9
Make: Honda
Color: Blue
Owner: Jeremy Bowers
Height: 6'1"
Weight: 204 lbs

License Plate L337WR9
Make: Honda
Color: Blue
Owner: Jacqui Maher
Height: 6'2"
Weight: 130 lbs

clue 7:

egrep '((Erika Owens)|(Aron Pilhofer)|(Heather Billings)|(Joe Germuska)|(Jeremy Bowers)|(Jacqui Maher))' ./people | grep '\tM\t' | cut -f1

Joe Germuska
Jeremy Bowers
Aron Pilhofer

egrep -R '((Joe Germuska)|(Jeremy Bowers)|(Aron Pilhofer))' ./memberships

All MemberShips: Jeremy Bowers
who did it? may be Jeremy Bowers

# Search for person with the Latte
grep Annabel ./people

# Knock on her door
less streets/Mattapan_Street
# Goto line in file using less: http://stackoverflow.com/questions/8586648/going-to-a-specific-line-number-using-less-in-unix
# in less type 173g
# Try different interviews
less interviews/interview-47246024

less interviews/interview-699607

# Checking for vehicle
less vehicles
# Search in less for vehicles starting with L337 and ending in 9
# in less /L337..9
# Check which are over 6'
# Katie Park
# Mike Bostock
# John Keefe
# Erika Owens
# Matt Waite
# Brian Boyer
# Al Shaw
# Miranda Mulligan
# Joe Germuska
# Jeremy Bowers
# Jacqui Maher

# Check which is male/female and get their names
egrep '((Katie Park)|(Mike Bostock)|(John Keefe)|(Erika Owens)|(Matt Waite)|(Brian Boyer)|(Al Shaw)|(Miranda Mulligan)|(Joe Germuska)|(Jeremy Bowers)|(Jacqui Maher))' ./people | grep '\tM\t' | cut -f1

# Limit down by membership
egrep -R '((Joe Germuska)|(Brian Boyer)|(Mike Bostock)|(Jeremy Bowers)|(John Keefe)|(Al Shaw)|(Matt Waite))' ./memberships

# (Jeremy Bowers)|(Brian Boyer)|(Mike Bostock)|(Matt Waite)
# Not MB, wrong car color
# Not MW, wrong car manufacturer
# Not BB, wrong car manufacturer
# JB, it is JB
```