For the next set of questions give your answer in the form o
For the next set of questions, give your answer in the form of the Linux command that will satisfy the listed task. The first question has been answered as an example.
1. Display the contents of “homework.txt” to STDOUT
cat homework.txt
2. Open the file “homework.txt” for editing using the nano text editor
3. Make a backup of “homework.txt” by copying it to another file named “homework_backup.txt”
4. Delete your original “homework.txt” file
5. Download your friend’s homework file located at http://www.dirtyhomeworkcheater.com/it2910/hw1.txt and save it as “copied_homework.txt”
6. Look at the differences between your friend’s homework (copied_homework.txt) and your homework file (homework_backup.txt)
7. You realize that your friend is an idiot; delete your friend’s homework file (copied_homework.txt)
8. Change the name of “homework_backup.txt” to “homework.txt”
9. Upload your homework file to another computer on your local network; specifically, to the computer that has the IP address 192.168.1.23
10. Exit the shell
Solution
[1] cat homework.txt
[2] nano homework.txt
[3] cp homework.txt homework_backup.txt
[4] rm homework.txt
[5] wget http://www.dirtyhomeworkcheater.com/it2910/hw1.txt -O copied_homework.txt
[6] diff -u homework_backup.txt copied_homework.txt > difference.txt
[7] rm copied_homework.txt
[8] mv homework_backup.txt homework.txt
[9] scp tux@192.168.1.23:/homework.txt
[10] exit
