Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here, we will create a new directory and move into it. Make the directory name your uni (this is important for later)'firstdir':

 


Code Block
languagebash
$ mkdir cmh329firstdir 
$ cd cmh329firstdir


 

Here we used the mkdir command (meaning 'make directories') to create a directory named 'cmh329firstdir' (or your uni). Then we moved into that directory using the cd command.

But wait! There's a trick to make things a bit quicker. Let's go up one directory. 


Code Block
languagebash
$ cd ..


 

Instead of typing cd cmh329firstdir, let's try to type cd c (or first letter of your uni) and f and then hit the Tab key. We notice that the shell completes the line to cd cmh329firstdir/.

2.0 Tab for Auto-complete

...

2.1 Reading files

If you are in YourUnifirstdir, use cd .. to get back to the CUL-MWG-Workshop-master directory.

...

Code Block
languagebash
$ mkdir cmh329_results

Now let's try our first search:

...

As before, cycling back and adding > cmh329_ results/, followed by a filename (ideally in .txt format), will save the results to a data file. Go ahead and do this on your own.

...

Code Block
languagebash
$ grep -i metadata *.csv > cmh329_results/2017-02-15_metadata-ecommons.csv

...

Code Block
languagebash
$ grep -iw revolution *.csv > cmh329_results/DATE_JAiw-revolution.csv

...

Code Block
languagebash
$ wc -l cmh329_results/*.csv
     186 cmh329_results/2017-02-15_metadata-ecommons.csv
     162 cmh329_results/DATE_JAiw-revolution.csv
     348 total

...