...
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 | ||
---|---|---|
| ||
$ 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 | ||
---|---|---|
| ||
$ 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 | ||
---|---|---|
| ||
$ 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 | ||
---|---|---|
| ||
$ grep -i metadata *.csv > cmh329_results/2017-02-15_metadata-ecommons.csv |
...
Code Block | ||
---|---|---|
| ||
$ grep -iw revolution *.csv > cmh329_results/DATE_JAiw-revolution.csv |
...
Code Block | ||
---|---|---|
| ||
$ wc -l cmh329_results/*.csv 186 cmh329_results/2017-02-15_metadata-ecommons.csv 162 cmh329_results/DATE_JAiw-revolution.csv 348 total |
...