Linux Lab 01 PDF
Linux Lab 01 PDF
Q2
c. Press Enter at the end of the last line, then Ctrl+D to denote the end of the file.
d. Use ls again to verify that the new file exists.
e. Display the contents of the file.
Coding:
Q3
a. Create a second file. Call it secret-of-the-universe, and put in whatever content you deem
appropriate.
b. Check its creation with ls.
c. Display the contents of this file. Minimize the typing needed to do this:
i. Scroll back through the command history to the command you used to create the file.
ii. Change that command to display secret-of-the-universe instead of creating it.
Coding:
Q4
After each of the following steps, use ls and cat to verify what has happened.
a. Copy secret-of-the-universe to a new file called answer.txt. Use Tab to avoid typing the existing
file’s name in full.
b. Now copy hello.txt to answer.txt. What’s happened now?
c. Delete the original file, hello.txt.
d. Rename answer.txt to message.
e. Try asking rm to delete a file called missing. What happens?
f. Try copying secret-of-the-universe again, but don’t specify a filename to which to copy. What
happens now?
Coding: