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

Question 1 Write a single command to copy a file named \'quizfile\' to your curr

ID: 3556791 • Letter: Q

Question

Question 1

Write a single command to copy a file named 'quizfile' to your current directory; the file is in the parent directory to your current directory. However, after the copy, you do not want a version to exist in the parent directory. (assume you have all permissions required)

Question 2

Write a single command that would remove the entire directory branch that starts with a directory called 'oldstuff' which is in your current directory (which also happens to be your home directory); the command should process without regard to whether subdirectories of oldstuff have entries in them or not.

Write a command that would display only the 17th line of a file named 'sourcefile'.

Write a command that would copy the entire contents of a directory called 'sourcedata' into a directory called 'destination'; both directories are subdirectories of your home directory (which is where you are when you type the command).

Question 5

Write a single command that would create three new directory levels below your current directory; the new levels are to be called: d1, d2, and d3 (where d3 is inside d2 and d2 is inside d1).

Write a command that would combine two files, fileA and fileB, in a side-by-side structure where the contents are separated by a hyphen (-); the contents of fileB should be on the left side, fileA on the right and the results should appear in a file called fileC.

Write a command sequence (using pipes) that would extract the 4th field from every line of a file called 'miscdata' and would then sort that data alphabetically and put the results in a file called 'sorteddata'. The file miscdata uses a colon as the field separator

Write a command that will display the file longdata with both backward and forward page control - AND which will show line numbers for each line of data from the file.

Explanation / Answer

1.
Copying (or moving) from the parent directory into the current directory
You would use the following commands to copy or move a file from the parent directory into the current directory

             cp ../quizfile .

or

             mv ../quizfile .

    The dot at the end of these commands stands for the current directory. Note that there is a space in front of this final dot.

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