Skip to content

Commit

Permalink
adds some suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
oceansize committed Mar 10, 2016
1 parent 5d699d0 commit 6739f77
Show file tree
Hide file tree
Showing 25 changed files with 88 additions and 73 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The Command Line Murders

There's been a murder in Terminal City, and TCPD needs your help.

Before you start skim through the required materials in [Command Line chapter](https://github.com/makersacademy/pre_course/blob/master/command_line.md) and [Version Control Chapter](https://github.com/makersacademy/pre_course/blob/master/version_control.md). Use it as a reference while working through the mystery.
Before you start skim through the required materials in [Command Line chapter](https://github.com/makersacademy/pre_course/blob/master/command_line.md) and [Version Control Chapter](https://github.com/makersacademy/pre_course/blob/master/version_control.md). Use it as a reference while working through the case.

Now with your Terminal at hand you're ready to start. A couple of ground rules first:

Expand All @@ -46,9 +46,9 @@ Next you need to download those files to your machine so that you can edit them.

## Step 2: Investigate

Each step of your investigation will contain the reference at the top. This reference contains the description of the commands you will need to complete the step. You can view them in the Terminal or by navigating to a file on Github.
Each step of your investigation will contain a reference to the **Detective Handbook** at the top. Each page of the Detective Handbook contains the description of the commands you will need to complete that particular step. You can view them in the Terminal.

Reference: ./reference/getting_started.md
Reference: ./detective_handbook/getting_started.md

Open a Terminal, go to the location of the files (using the `cd` command), and start by reading the file 'step0'.

Expand All @@ -65,4 +65,4 @@ Projects: [noahveltman.com](http://noahveltman.com)
GitHub: [veltman](https://github.com/veltman)
Twitter: [@veltman](https://twitter.com/veltman)

Adapted by the Makers Team
Adapted by the Makers Academy Team
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion reference/step1-git.md → detective_handbook/step1-git.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Git status shows what changes you have made since the last commit. The output of

# `git push`

After you committed the changes they still only exist on your machine. To "share" the work you need to push the changes to a remote repository. If you cloned the repository from Github you already have a remote repository setup. When you push your changes they will be pushed to Github. Type `git push` to push your commits.
After you have committed the changes, they still only exist on your machine. To "share" the work you need to push the changes to a remote repository. If you cloned the repository from Github you already have a remote repository setup. When you push your changes they will be pushed to Github. Type `git push` to push your commits.
File renamed without changes.
10 changes: 5 additions & 5 deletions reference/step3.md → detective_handbook/step3.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Wildcard

`ls cats/` prints out all files in the 'cats' directory. What if you only want to print out txt files? Or files with names starting with "cute_"? To do that you can use asterisk symbol:
`ls kitties/` prints out all files in the 'kitties' directory. What if you only want to print out txt files? Or files with names starting with "cute_"? To do that you can use asterisk symbol:

`ls cats/*.txt`
`ls kitties/*.txt`

`ls cats/cute_*`
`ls kitties/cute_*`

The asterisk (wildcard) is a "match all" symbol. When you type `ls cats/cute_*` command line interprets it as "print all the files in the cats directory that start with 'cute_'". The rest of the name could be anything as `*` matches all possible strings.
The asterisk (wildcard) is a "match all" symbol. When you type `ls kitties/cute_*` command line interprets it as "print all the files in the kitties directory that start with 'cute_'". The rest of the name could be anything as `*` matches all possible strings.

# `find`

Expand All @@ -20,7 +20,7 @@ This command works a lot just like normal English. It's saying: "find all files,

`ls -a` prints all files and directories including the ones whose names begin with `.`

`ls -l` prints all files as a list with all the information about files like permissions, owner, last modified time and size
`ls -l` prints all files as a list with all the information about files like permissions, owner, last modified time and size.

`ls -h` when used with `-l` option prints file size in a human readable format (Kbytes, Mbytes etc.) instead of bytes.

Expand Down
13 changes: 13 additions & 0 deletions detective_handbook/step4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `head`

`head -N` command will print out first N lines of the file.

# `tail`

`tail -N` is the opposite of `head`. It will print out last N lines of the file.

# `|`

The pipe operator - `|` - allows you to "pipe" or direct the output of one command into the input of another command. For example if you wish to search for "British" in 'kitties.txt' and then search for "Shorthair" in the results of the first search you can use the combination of `grep` and `|`:

`grep British kitties.txt | grep Shorthair`
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions hint1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Try poking around what's in a file by using the 'head' command:
Try poking around the contents of a file by using the 'head' command:

head -n 20 people

This will show you the first 20 lines of the 'people' file.

Try to search for 'Annabel' in the 'people' file.
Try to search for 'Annabel' in the 'people' file.
13 changes: 0 additions & 13 deletions reference/step4.md

This file was deleted.

6 changes: 3 additions & 3 deletions step0
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ OOOOOOO' `@@a @@a@@ @@"" a@@ a |@@@ OOOO3
`OOOO' `@ aa@@ aaa""" @a a@ a@@@',OOOO'


Reference: ./reference/step0.md
Reference: ./detective_handbook/step0.md

There's been a murder in Terminal City, and TCPD needs your help.

All the materials needed to figure out who did it are in the 'mystery' subdirectory. Using the commands from the reference take a look around to see what files are in the 'mystery' subdirectory.
All the materials needed to figure out who did it are in the 'mystery' subdirectory. Using the commands from the Detective Handbook take a look around to see what files are in the 'mystery' subdirectory.

Once you answered the questions above open 'step1' file to start collecting the clues.
Once you answered the questions above, read the 'step1' file via your terminal to start collecting the clues.
17 changes: 9 additions & 8 deletions step1
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
Reference: ./reference/step1.md
Reference: ./detective_handbook/step1.md

Now it's time to collect the clues! The officers on the scene are pretty meticulous, so they've written down EVERYTHING in their officer reports. Take a look at the 'mystery/crimescene' file. It's quite large so use `less` command to view the contents of the file one screen at a time.
Now it's time to collect the clues! The officers on the scene are pretty meticulous, so they've written down EVERYTHING in their officer reports. Take a look at the 'mystery/crimescene' file. It's quite large so use the `less` command to view the contents of the file, one screen at a time.


#### Challenge ####
############ Challenge ###############

How can you view the file in another directory without switching to the directory first? What is the difference between absolute paths and relative paths?
How can you view a file in different directory without switching to that directory first? What is the difference between absolute paths and relative paths?

###################
######################################


You need to search for the lines in the file marked with the word 'CLUE'. Use the `grep` command to do that.

Once you found all the clues it's time to save them to a separate file for the future reference.
You need to search for lines in the file marked with the word 'CLUE'. Use the `grep` command to do this.

Once you've found all the clues it's time to save them to a separate file for future reference.

Use `touch` to create a file named 'clues.txt'. Use `>` to save the output of the `grep` command to the 'clues.txt' file.

That's the first step done! Open 'step1-git' to see how you can track your work with version control system.
That's the first step done! Open 'step1-git' to see how you can track your work using a version control system (git).
18 changes: 12 additions & 6 deletions step1-git
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,22 @@
| `""M M""` |
'------------------------------------------------------------------------------'

Reference: ./reference/step1-git.md
Reference: ./detective_handbook/step1-git.md

To push your 'clues.txt' file to Github first add the file using `git add`.
A good detective always backs up their case files. You never know when an 'accident' will befall a filing cabinet whilst someone is under investigation...

To push (upload) your 'clues.txt' file to Github, first "add" the file using `git add`.

#### Challenge ####

Is there a git command to view what changes you made in your repository? How can you tell what changes are going to be added to the next commit?
############ Challenge ###############

###################
Is there a git command to view what changes you've made in your repository?

How can you tell what changes are going to be added to the next commit?

Commit your changes using `git commit`. Don't forget to write a meaningful commit message! Now push the commit you've just made to Github using `git push`. All done! Open 'step2' to see what comes next.
######################################


Commit your changes using `git commit`. Don't forget to write a meaningful commit message (you'll thank yourself in future)!

Now push the commit you've just made to Github using `git push`. All done! Read 'step2' to see what comes next.
16 changes: 9 additions & 7 deletions step2
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
Take a look inside your 'clues.txt'. What does the third clue tell you? What are the files in the 'mystery' directory you should look next based on this clue?
Take a look inside your 'clues.txt'. What does the third clue tell you? Within the 'mystery' directory, which files should you look at, based on this clue?


#### Challenge ####
############ Challenge ###############

Sometimes you don't want to see the whole file, but just to peek inside it to get the idea of what the content is. Research `tail` and `head` commands. Try these commands on the files in the 'mystery' directory.
Sometimes you don't want to see the whole file, but just peek inside it to get an idea of the content.
Research the `tail` and `head` commands. Try these commands on the files in the 'mystery' directory.

##################
######################################


Now you know all the commands you need to find this mysterious woman.
Now you know all of the commands you'll need to find the mysterious woman.

Create a file called 'possible_witnesses.txt' containing the list of all women matching the barista's description and their addresses. Commit and push the file to Github.
Create a file called 'possible_witnesses.txt' containing a list of all women matching the barista's description and their addresses.
Commit and push the file to Github.

If you get stuck look inside 'hint1'

Once you've done that go to step3.
Once you've done that go to step3.
15 changes: 8 additions & 7 deletions step3
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
Reference: ./reference/step3.md
Reference: ./detective_handbook/step3.md

You got 4 matches for the name Annabel. Only 2 of them are women so you can rule out the other 2. Another piece of information you have is their addresses. There is a 'streets' subdirectory in a 'mystery' directory with a list of files named after streets.
You found 4 matches for the name 'Annabel'. Only 2 of them are women so you can rule out the remainder. Another piece of information you have is their address. There is a 'streets' subdirectory in the 'mystery' directory with a list of files named after streets.

#### Challenge ####
############ Challenge ###############

See if you can find files matching street names for two remaining Annabels. Use the combinations of commands from the reference to the step 3 to do this.
See if you can find files matching street names for two remaining women named 'Annabel'. Use the combinations of commands from the Detective Handbook (section step3) to do this.

###################
######################################

Take a look inside the files you've found. Remember you have a lane number in your 'possible_witnesses.txt' too. See if you can figure out how you can find something useful in those files using this information.

If you get stuck look into hint2.
Take a look inside the files you've found. REMEMBER: among the information available in 'possible_witnesses.txt', you have references to line numbers. See if you can use that line number to discover something useful about the lady called 'Annabel'.

If you get stuck check out hint2.

Move on to step4.
12 changes: 6 additions & 6 deletions step4
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Reference: ./reference/step4.md
Reference: ./detective_handbook/step4.md

#### Challenge ####
############ Challenge ###############

Use the combination of head, tail and | operator to view exactly the line you're interested in.
Use the combination of `head`, `tail` and `|` operators to view exactly the line you're interested in.

##################
######################################


Save the contents of this line in both address files to a file named 'interviews.txt', commit it and push to Github.
You have two addresses to investigate. Create a file for your reference called `interviews.txt`. Find the relevant line in each of the two address files, and save the contents to 'interviews.txt'. Commit it and push to Github.

Now let's move to step5.
Now let's move to step5.
6 changes: 4 additions & 2 deletions step5
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Reference: ./reference/step5.md
Reference: ./detective_handbook/step5.md

To get to this step `git checkout` the 'step-5' branch and try to visit this file again.
You're concerned that the investigation has been compromised. You use an old detective's trick to cover your tracks.

To get to this step use the `git checkout` command to check out the 'step-5' branch, and try to view this file again.
7 changes: 4 additions & 3 deletions step6
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Reference: ./reference/step6.md
Reference: ./detective_handbook/step6.md

Now you have more information to identify the perpetrator. Peek into 'mystery/vehicles' file. What information does it contain? Look into your 'clues.txt' again - is there anything else you can search for in the vehicles record?

#### Challenge ####
############ Challenge ###############

Now you need to search for multiple keywords in one file. How can you combine `grep` with flags and pipe operator to filter vehicles record for car model, color, license plate number and suspect's height?

###################
######################################


Save the list of suspect into 'suspects.txt', commit and push to Github.

Expand Down
7 changes: 4 additions & 3 deletions step7
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Reference: ./reference/step7.md
Reference: ./detective_handbook/step7.md

Now you're down to 4 suspects. First, remove all files you've created but 'clues' and 'suspects', you don't need them anymore.


#### Challenge ####
############ Challenge ###############

How can you tell what files you've added? Can you use git to see the changes between one commit and another?

###################
######################################


Move on to step 8.
7 changes: 4 additions & 3 deletions step8
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
Reference: ./reference/step8.md
Reference: ./detective_handbook/step8.md

The last clue that you have left is the list of memberships in the wallet found at the crimescene. All you need to do now is to see if one of the suspects has all these memberships.

What files does the 'mystery/memberships' subdirectory contain? What is inside these files?


#### Challenge ####
############ Challenge ###############

Remember that the `cat` command was originally intended for concatenating files. Using this how can you tell if one suspect has all of the memberships?

How many membership cards were in the wallet? Can you automatically count if the suspect has all of them using `grep`, `wc` and the pipe operator?

###################
######################################



If you got it down to one suspect check if he's the one by following the instructions in the 'solution' file.
Expand Down

0 comments on commit 6739f77

Please sign in to comment.