CSIRO Ag&Food Data School

Intro to command lines and Git, revision activities

Morning 2 shell revision

  1. Change Directory back to your work folder on the Bowen drive (/{letter}/work/{COHORT}/{IDENT}/)

  2. And then into content/week01/shell-intro/north-pacific-gyre/

  3. List the files in this directory

  4. Make a new directory named z_samples

  5. Using wildcards, copy the files with a ‘Z’ in the name into z_samples

  6. Use ‘head’ to peek at the contents of the files you’ve copied into z_samples

  7. The files in z_samples contain a list of numbers. Use piped commands to list the 5 largest numbers they contain, combined

  8. Repeat 7., but direct the result into a file 5_largest_z_samples.txt

  9. Write a FOR loop to print just the smallest number in each sample file

  10. Advanced challenge: Write a FOR loop that would, in turn, print the 2nd, 5th, and 9th line of NENE01971Z.txt

« Index Next »