Skip to content

Latest commit

 

History

History
35 lines (19 loc) · 1.6 KB

terminal-exercise.md

File metadata and controls

35 lines (19 loc) · 1.6 KB

W2 - terminal exercise

  1. Using this tutorial from Software Carpentry, download data-shell.zip folder and extract it to the Desktop.

    • Warning: depending on the language settings in your computer your desktop can me named differently (e.g. Plocha in Czech)

For the following questions write answer and code to produce that answer

  1. How many folders are there? (Hint: use ls with appropriate parameter to print only directories) BONUS: using pipe print just the number of folders

  2. Move to molecules folder in data-shell. In what folder will you be by typing cd ../..?

  3. In molecules folder, sort files by file size in descending order (biggest files at top). What is the name of the first file?

  4. Rename creatures directory to non-existent creatures. What do you see when you go into thet directory and type pwd?

  5. Copy all files from molecules directory to north-pacific-gyre. What command will you use?

  6. Now, put everything as it was before step 5 and 6. What commands will you use?

  7. Create empty file and name it random_stuff.txt. What command will you use?

  8. Print the output of ls -l of current directory into the file created in previous step. What do you see when you open that file?

  9. Remove file random_stuff.txt. What command will you use?

  10. BONUS: using pipes create command that:

    • Read data-shell/data/planets.txt file
    • Search for WASP in file
    • Sort by second column in descending order
    • Print first 5 lines