Skip to content

Lesson 3: Practice questions

For these practice questions, check the present working directory and if needed, change into the /data/username folder (username is the student account ID).

Question 1

Copy the lesson3_practice folder from /data/classes/BTEP/unix_on_biowulf_2024_practice_sessions to the present working directory, which should be /data/username.

Solution

cp -r /data/classes/BTEP/unix_on_biowulf_2024_practice_sessions/lesson3_practice .

Question 2

Change into the lesson3_practice folder.

Solution

cd lesson3_practice

Question 3

How many files and directories are in the lesson3_practice folder?

Solution

ls -l
drwxr-x--- 2 wuz8 wuz8 4096 Jan 18 21:34 sample_sequence_data
-rw-r----- 1 wuz8 wuz8   46 Jan 18 21:34 text1.txt

One director and one file.

Question 4

Rename text1.txt to text_file1.txt.

Solution

mv text1.txt text_file1.txt

Question 5

Make a copy of text_file1.txt and call it text_file2.txt.

Solution

cp text_file1.txt text_file2.txt

Question 6

Delete text_file2.txt.

Solution

rm text_file2.txt