For each command give me the ENTIRE COMMAND SEQUENCE. If I ask you \'What comman
ID: 3705923 • 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.
6. I have two servers (A & B) running Linux. Both are running OpenSSH. I'm logged into Server A as user 'james'. I have an account on B called 'tiberius.' I want to use scp to copy the file 'foo.txt' from A (IP = 192.168.1.101) to B (IP = 192.168.1.202) to the directory /home/tiberius/Desktop. What command would I use? (5 points) 7. What is the command to set your system date to May 5, 2015 10:00AM? (5 pts) 8. Run the command that updates your date using an ntp server from Google. (5 pts) 9. What command would I run if I want to archive and compress all of the files in ~/Desktop/backups to a file called '~/mybackups.tgz'? (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 extension '*.txt' under / (the root directory) with the last accessed date is less than five days ago and is owned by user 'thedoctor'. (5 pts)
Explanation / Answer
6.The basic scp syntax is : scp sourcefilename username@destinationhost:destinationfolder
Here the answer is scp foo.txt tiberius@192.168.1.202:/home/tiberius/Desktop by the given constarints.
7. sudo date --set "5 May 2015 10:00:00"
The required date should be given in the String format "Date Month(Three letters Year Time(24Hrs format with minutes and seconds))
8. sudo ntpdate time.nist.gov is the comand.
If ntp server is not started use: sudo service ntp start (start command)
If already in use error comes just stop using command: sudo service ntp stop (stop command) and restart and start ntp server using the start command above.
9. The archived files re called tarballs in linux systems."tar.gz or .tgz"
In the home (~) directory, we use the command: tar -czvf mybackups.tgz ~/Desktop/backups
c: to create an archive
z: zip or compress using gzip
v: Display the process on terminal (its optional here)
f: to specify a file name for the archive, here it is mybackups.tgz
10. We can use:
find / -type f -name "*.txt" -user thedoctor -mtime +5 -delete
Hope this helps.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.