Exercises

Download and unzip the ex-data.zip file and perform the following actions.

  1. Move to the directory ex-data/docs/thesis/ and list its content.
  2. What's the most recent document in ex-data/docs/thesis?
    HINT: ls has a flag that lists many properties of the files in a directory.  Read the manual.
  3. List all the directories and all the files in ex-data.  What's the largest file?
    HINT: ls allows to recursively list all the directories and to print sizes in human readable form.
  4. Copy the books directory and its content to ex-data/docs.
    HINT: you can recursively copy elements.
  5. Remove the directory ex-data/books and its content (using a single command).
  6. List all the directories and all the files in ex-data.  Save the list in ex-data/file-list.txt
  7. Use nano to add a sentence at the beginning of ex-data/file-list.txt that describes the content of the file.
  8. Sort lexicographically the elements of ex-data/data/tracking.csv.
    Note that the first line of the file it's the header.  Find a way to remove it from the sorting (without modifying the file).
  9. Sort the file ex-data/data/tracking.csv by the numerical value of the fourth field.
  10. Sort the file ex-data/data/tracking.csv by the values of the third field.  Note that these values have suffixes (e.g., K, M, G).
  11. Create the file ex-data/data/sorted.tracking.csv that contains the elements of ex-data/data/tracking.csv sorted as described in point 10.
    This file must include the header as the first line.
    The final file should be composed of 10001 lines (you can use the command wc -l ex-data/data/sorted.tracking.csv to check the number of lines).
  12. Print the content of all the files in ex-data/docs/ascii-art using a single command.
    HINT: cat accepts multiple arguments

Last modified: Thursday, 1 October 2020, 10:52 AM