Chapter 7 Exercise 1

Perform the following tasks with the skills and knowledge you have gained.

Before carrying out the tasks, ensure you are in your ~/Linux directory.

You can check my solutions by clicking the expandable boxes like the one below ("Move to correct directory"). These are not the definitive solution but only examples of solutions. If your method works and you understand why then you have carried it out correctly.

cd ~/Linux/

7.1 Exercise 1 tasks

7.1.1 Task 1

Change the name of the subdirectory "four_exercises" within your "Linux" directory to "4_exercises".

mv four_exercises 4_exercises

Task 2

Make a backup of the "4_exercises" directory

cp -r 4_exercises 4_exercises_backup 

Task 3

List the contents of the "4_exercises" directory

ls 4_exercises

Task 4

Within the directory "4_exercises"

  1. Print the working directory.
  2. Print out to screen the phrase ‘the echo command allows me to print phrases to screen’.
  3. Copy the file "copy_this_file.txt" to the directory "to_me"
  4. Rename the directory "to_me" to "you"
  5. Delete the initial "copy_this_file.txt" file

First move into the "2_exercises" directory

cd 4_exercises

Print the working directory

pwd

Print out to screen the phrase ‘the echo command allows me to print phrases to screen’

echo “the echo command allows me to print phrases to screen”

Copy the file copy_this_file.txt to the directory to_me

cp copy_this_file.txt to_me

Rename the directory to_me to you

mv to_me you

Delete the initial copy_this_file.txt file

rm copy_this_file.txt

7.2 Exercise 1 conclusion

Brilliant! I hope those tasks helped improve your Linux skills through application.

Please continue on with the materials and remember you can ask for help and look at the cheatsheet.