(E) WorkbookΒΆ

Goal: I will learn how to use command line by cleaning the given files to correct directories.

Instructions: Retrieve the necessary files: templates/01-14/command_line/ -> student/01-14/command_line/. (If you did not do this at the beginning of the round, do it now by the command line instead of the graphical user interface.)

Starting actions: Unzip the zip file found in the directory as:

unzip cl_manipulation.zip

Note that the above command created a new subdirectory cl_manipulation, in which the files are unzipped. Move to this subdirectory.

Cleaning a directory: Remove all temporary files (files with ~ suffix).

In the directory cl_manipulation, create new subdirectories named as workbook/figures/, workbook/figures/mazes/, workbook/jokes/, and coding/.

Sort the files of the zip package such that

  • all figure files with .gif suffix lie in the directory workbook/figures
  • maze figures, i.e. the figure files with .png suffix lie in the directory workbook/figures/mazes
  • text files (.txt) lie in the directory workbook/jokes
  • source code files, i.e. all the rest files after the previous actions lie in directory coding.

A tip: You can move several files at the same time by using special characters.

Editing files: Joke files contain jokes on Pikku-Kalle (in English: Little Johnny). Time has passed such a lot that Pikku-Kalle cannot be called Pikku-Kalle any more. In all joke files, change Pikku-Kalle as Iso-Kalle (in English: Big Johnny).

A tip: You can do this by a single command. Read about sed at the end of the previous material section.

Submission: Navigate to the directory student/01-14/command_line, zip the directory cl_manipulation, and replace the old cl_manipulation.zip with the newer one. This can be done with command:

zip -FSr cl_manipulation.zip cl_manipulation/

Add the file to Git as:

git add cl_manipulation.zip
git commit -m "Cl_manipulation submission"
git push

As you can see, using Git in the command line is natty. We will discuss this later in more detail.

A+ presents the exercise submission form here.