Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Create a symbolic link called ~/Desktop/food.doc that links to ~/Documents/ba

ID: 3849401 • Letter: 1

Question

1. Create a symbolic link called ~/Desktop/food.doc that links to ~/Documents/bard.txt. (5 pts) 2. Create a command that will run the file /etc/runme.sh at 5AM using the 'at' command. (5 pts) 3. I just ran a command that will run longer than I expected and I want to stop it. The PID of the process is 1234. What command could I run to stop the process? (5 pts) 4. Create a command that will create an MD5 hash of all the files in the /usr/bin directory, and save it to a file called ~/Documents/executables.md5. (You did watch the videos, right?) CHECK YOUR COMMAND! (5 pts) 5. Create a command that does a long, recursive directory listing of all files under /var/log making sure to ignore standard error. CHECK YOUR COMMAND! (5 pts) 6. I have two servers (A & B) running Linux. Both are running OpenSSH. I'm logged into A as user 'Fred.' I have an account on B called 'Ethel.' I want to use scp to copy the file 'fred.doc' from A (IP = 10.10.10.1) to B (IP = 10.10.10.2) to the directory /home/Fred/Desktop. What command would I use? (5 points) 7. Run the command that updates your date using an ntp server from Ubuntu. (5 pts) 8. What is the command to set your system date to Nov 8, 2014 10:00PM? (5 pts) 9. What command would I run if I want to archive and compress all of the documents in ~/Desktop/backups/2015 to a file called '~/backups.bz2'? Remember you are in ~. (5 pts) 10. Below, create a simple shell script (something I could copy directly from your assignment into a text file and run) that would delete all files with the name "Fred.*" under /var/log whose whose size is less than 1MB. (5 pts) 11. I just created the following shell script in the file "runme.sh": #!/bin/sh find / -type f -name *.tmp -size +10k -size -20k -exec rm {} ; I save the file, and then attempt to run it. “ received the error bash: ./runme.sh: Permission denied. Show me the command that solves the problem. (5 pts) 12. Create a command that will search for files under /etc that contain the keyword "PAM", and return a COUNT of the number of files. That's all I want to see, a number. (User the man pages: 5 pts) 13. Create a command that will identify files under /usr/sbin that are greater than 1 kilobyte and less than 1MB. (5 pts) 14. Create a command that will run the script runme.sh one hour from now. (5 pts) 15. I've run 24 commands in the background from a terminal. Some of these I know will take some time to complete. How would I find out what commands have not completed yet? (5 pts) 16. What command could I run to determine whether the ssh daemon is listening? (There are a couple of correct answers here.) How would you check this? Hopefully you've installed OpenSSH (shown in the videos). Then identify the command, it should show that ssh/port 22 as "listening.' (5 pts) 17. I have a directory called "~/MyFiles." It's owned by user 'pc' and group 'pc.' Change the ownership so that it is now owned user 'super' and group "secret". (5 points) 18. Create a crontab entry that would run the file /etc/clear.sh every day at 3AM. 19. Create a crontab entry that would run the file /etc/clear.sh every Wednesday at 5:01PM. 20. Create a command that will find all files under / that end in the extension *.txt, and whose contents contain either the word "new" or "old" or "borrowed" or "blue". (Look at egrep, watch the video!). CHECK YOUR WORK! (5 points).

Explanation / Answer

2. The at command schedules a command to be run once at a particular time. This can be any command that you normally
have permission to run; anything from a simple reminder message, to a complex script.
command: "at -m 05 < /etc/runme.sh"


3. Command: Kill -9 1234

4. To generate an MD5 hash
Take example file "file.iso" and save the result to a text file under /var/log/

Command: md5sum file.iso > /var/log/file.iso.md5

5. Goto to the specific directory like command : cd /var/log/
then type Command: ls -R for long and recursive directory list

6. login into server A
Goto to the fred.doc located directory
and type command:
scp -R fred.doc root@10.10.10.2:/home/Fred/Desktop
Now it will promt for user then give user:Ethel and asks for Ethel user password.
Done!!

7. Try the below commands in command line:
- sudo service ntp stop
- sudo ntpdate -s time.nist.gov
- sudo service ntp start

8. Command: date -s "8 NOV 2014 22:00:00"