Command-Line Mystery

This notebook sets you up for running Noah Veltman's commandline mystery.

To check where we are, display the current working directory.

There are a several of ways we can do this, either using IPython magic:

In [38]:

or a command line / shell command invocation:

In [39]:

Download the mystery

The mystery files are provided in a zip file that we can download from

The %%bash block cell magic allows us to write several bash shell commands, that all execute wihting the same shell environment, in a single code cell:

In [11]:
#Download (wget) the file from the specified URL quietly (-q)
wget -q

#Unzip the file very quietly (-qq)
unzip -qq

#Delete the downloaded zip file

#Display the contents of the unzipped file directory
ls clmystery-master

It probably makes sense to read the README.html

In [40]:
!cat clmystery-master/
The Command Line Murders

	.OOOOOOOOOOOOOOO @@                                   @@ OOOOOOOOOOOOOOOO.
	OOOOOOOOOOOOOOOO @@                                    @@ OOOOOOOOOOOOOOOO
	OOOOOOOOOO'''''' @@                                    @@ ```````OOOOOOOOO
	OOOOO'' [email protected]@@@@@@@@@@@@@@@@@@@"""                   """""""""@@aaaa `OOOO
	OOOOO,""""@@@@@@@@@@@@@@""""                                     [email protected]"" OOOA
	OOOOOOOOOoooooo,                                            |OOoooooOOOOOS
	OOOOOOOOOOOOOOOOo,                                          |OOOOOOOOOOOOC
	OOOOOOOOOOOOOOOOOO                                         ,|OOOOOOOOOOOOI
	OOOOOOOOOOOOOOOOOO @          THE                          |OOOOOOOOOOOOOI
	OOOOOOOOOOOOOOO'a'            LINE                         |OOOOOOOOOOOOOy
	OOOOOOOOOOOOOO''              MURDERS                      aa`OOOOOOOOOOOP
	OOOOOOOOOOOOOOb,..                                          `@aa``OOOOOOOh
	OOOOOOOOOOOOOOOOOOo                                           `@@@aa OOOOo
	OOOOOOOOOOOOOOOOOOO|                                             @@@ OOOOe
	[email protected]                               aaaaaaa       @@',OOOOn
	[email protected]                        [email protected]@@@@@@@""        @@ OOOOOi
	OOOOOOOOOO~~ aaaaaa"a                 [email protected]@@@@@@@@@""            @@ OOOOOx
	OOOOOO [email protected]"""""""" ""            @@@@@@@@@@@@""               @@@|`OOOO'
	OOOOOOOo`@@a                  [email protected]@  @@@@@@@""         [email protected]        @@@@ OOOO9
	OOOOOOO'  `@@a               @@[email protected]@   @@""           [email protected]@   a     |@@@ OOOO3
	`OOOO'       `@    [email protected]@       aaa"""          @a        [email protected]     [email protected]@@',OOOO'

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

To figure out whodunit, you need access to a command line.

Once you're ready, clone this repo, or [download it as a zip file](

Open a Terminal, go to the location of the files, and start by reading the file 'instructions'.

One way you can do this is with the command:

	cat instructions

(`cat` is a command that will print the contents of the file called `instructions` for you to read.)

To get started on how to use the command line, open or cheatsheet.pdf (from the command line, you can type 'nano').

Don't use a text editor to view any files except these instructions, the cheatsheet, and hints.

### Credits

By Noah Veltman  
Projects: [](  
GitHub: [veltman](  
Twitter: [@veltman](  

Just before you get started on solving the mystery, it's worth noting that each time we run a shell command using !, or use the %%bash magic, the commands are run in their own shell:

In [30]:
#Print (echo) the current directory (pwd)
!echo $(pwd)

#Change directory to the parent directory
# then (;) show the current directoy
!cd ..; echo $(pwd)

#Show the current directory
!echo $(pwd)

To "persistently" change the current directory, we need to change the directory used in the outer IPython environment from which the shell commands are run. We can do this using the %cd line magic:

In [33]:
%cd clmystery-master/mystery

List the contents of the current directory...:

In [17]:
! ls
crimescene  interviews	memberships  people  streets  vehicles

The instructions suggest we need to start by looking at the crimescene report:

In [ ]:
!cat crimescene

There's rather a lot in there, but we're told the clues are marked as a CLUE. TO get you started, here's one way of filtering out those items — use the grep command to search for lines containing the word CLUE:

In [21]:
!grep CLUE crimescene
CLUE: Footage from an ATM security camera is blurry but shows that the perpetrator is a tall male, at least 6'.
CLUE: Found a wallet believed to belong to the killer: no ID, just loose change, and membership cards for AAA, Delta SkyMiles, the local library, and the Museum of Bash History. The cards are totally untraceable and have no name, for some reason.
CLUE: Questioned the barista at the local coffee shop. He said a woman left right before they heard the shots. The name on her latte was Annabel, she had blond spiky hair and a New Zealand accent.

Now get to it...