2.5 Exercises

2.5.1 Files and Folders

See Section 12.0.2 for solutions.

  1. Create a directory “bashExercises”. Enter the directory. In here, we will do all the exercises in order to keep track of our files.

  2. Create two directories named ”human” and ”chimp”.

  3. Enter directory ”human” and create three empty files named ”DNA.txt”, ”brain.txt” and ”food.txt”. Check if they are present.

  4. Copy food.txt into the chimp directory.

  5. Change into the chimp directory and verify that a copy of food.txt is there.

  6. Move DNA.txt from the human directory to the chimp directory. Verify that human does not contain DNA.txt anymore, but that it is now in chimp.

  7. Get the file sizes of all files in chimp directory and of all files in human directory while still in chimp directory.

  8. Remove file brain.txt from human directory while still in chimp directory.

  9. Remove the whole directory human while still in chimp directory.