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

For each command give me the ENTIRE COMMAND SEQUENCE. If I ask you \'What comman

ID: 3705924 • Letter: F

Question

 For each command give me the ENTIRE COMMAND SEQUENCE. If I ask you 'What command would I use to move the file one.txt to the parent directory and rename it to two.txt?", the answer is NOT 'mv'. That is only part of the command. 
  1.  Create a symbolic link called ~/Desktop/bar.doc that links to ~/Documents/foo.txt. (5 pts)   2.  Create a command that will run the file ~/runthis.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 32123.  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/binaries.md5. (5 pts)   5.  Create a command that does a long, recursive directory listing of all files under /usr/sbin making sure to ignore standard error. (5 pts)

Explanation / Answer

Answer 1:

The syntax for creating a symbolic links is:

ln -s TARGET LINK_NAME

Following the syntax, the command would be:

ln -s ~/Documents/foo.txt ~/Desktop/bar.doc

Answer 2:

The syntax for running the at command is:

at [-V] [-q queue] [-f file] [-mMlv] timespec...

So the command is:

at -f ~/runthis.sh 05:00

Answer 3:

Processes can be killed by sending the SIGTERM signal. But this signal can also be blocked, handled or ignored by the process. For a forced kill, the SIGKILL signal can be used.

The syntax for sending a signal to a process is, with the default signal being SIGTERM:

kill [-SIGNAL] PID

So the command for stopping the process would be:

kill 32123

For a forced kill, the command would be (the value of SIGKILL is 9)

kill -9 32123

Answer 4:

The solution should iterate over all the files in the directory, check if it is a file, run the md5sum command and redirect the output to the required file. Before the md5 values are generated, the output file should be made blank. The command is as follows:

echo "" > ~/Documents/binaries.md5; for file in `ls /usr/bin`; do if [ -f /usr/bin/$file ]; then md5sum /usr/bin/$file >> ~/Documents/binaries.md5; fi; done

Answer 5:

The command for listing of directories is ls. For the long listing the "-l" flag needs to be used. For a recursive listing, the option is "-R". To ignore standard error, it should be redirected to the null device, /dev/null. For any command, standard ouput has a file descriptor value 1, and standard error has fd value 2. So file descriptor 2 should be redirected to null. The command according to the above explanation is as follows:

ls -lR /usr/sbin 2>/dev/null

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote