Need help to get the output of these three questions please. I need the step by
ID: 3890492 • Letter: N
Question
Need help to get the output of these three questions please. I need the step by step solution please.(Linux question)
8. Make your home directory (home/yourName) asthe working directory. Run command 'touch someFile Use relative pathname to copy someFile to RFile in the /tmp directory 9.Make your home directory (home/yourName) as the working directory. Run command 'touch someFile2 Use absolute pathname to copy some File2 to AFile in the /tmp directory 10. Using your home directory as the working directory, delete the files AFile and RFile that were created in problem 9-1 using absolute path namesExplanation / Answer
8. Make your home directory (home/yourName) as the working directory. Run command
'touch someFile'. Use relative pathname to copy someFile to 'RFile' in /tmp directory.
Make your home directory as the working directory: Usually when you login, this is the
default working directory. Where as if you are at root directory. You can change to this
directory using the command: >cd /home/yourName will move on to your home directory.
Run command 'touch someFile': So the command >touch someFile will create an empty file named
someFile in the present working directory.
Use relative pathname to copy someFile to RFile in /tmp directory: tmp is a directory which
will be available in root directory. So, to copy some file to RFile in tmp directory using
relative path the command will be: >cp someFile ../../tmp/RFile
Here the first ../ will lead you back to home directory, and the other ../ will lead you
back to root directory, and from there /tmp/ will move you into tmp directory, and there
the file named RFile is created with the content same as in someFile.
9. Make your home directory as the working directory. Run command 'touch someFile2'. Use
absolute path to copy someFile2 to AFile in /tmp directory.
Make your home directory as the working directory: As we are readily in home directory,
nothing is needed new here. If not, just follow steps as we did in the previous problem.
Run command 'touch someFile2': This is again same as we did in the previous problem.
The command >touch someFile2 will create an empty file in the present working directory.
Use absolute path to copy someFile2 to AFile: Previously we used the relative path, so, we
have to use ../ kind of commands, but here as we are going to use the absolute path,
the command will be: >cp someFile2 /tmp/AFile will do the needful.
10. Using your home directory as the working directory, delete the files AFile and RFile
that we created in previous problems using absolute path names.
As we're readily in home directory, nothing should be done to move to home directory.
Delete the files using absolute path names:
>rm /tmp/RFile /tmp/AFile this command will remove both the files on a single go.