Question: Question 2 (10 points) - Manipulate directory structures (starting from your home directory) a. Perform a command that displays the absolute path of your home
Question 2 (10 points) - Manipulate directory structures (starting from your home directory) a. Perform a command that displays the absolute path of your home directory (your current location). b. Create a new directory inside your home directory and name it COP3353-hw1 c. Navigate to the COP3353-hw1 directory. d. Create two new directories using one command inside of the COP3353-hw1 directory, and name them assign1 and assign2. e. Display the contents of your current working directory (the directory COP3353-hw1). f. Delete the directory assign2. g. Display the contents again of the directory COP3353-hw1, this time using the long listing format. Question 3 (10 points) - Manipulate files. Starting from the COP3353-hw1 directory you created in Q 2 a. Change your current working directory to assign1. b. Create a new directory (inside of the assign1 directory) called Files c. Create a new file (inside of the assign1 directory) called MyFile.txt using the touch command. d. Write a command to open the file MyFile.txt in a text editor of your choice, then do the following (I don't need to see the commands/keystrokes for the rest of this question) Insert three lines into the file (which you'll display in part e). The first line should be a sentence that tells me your favorite musician/band. The second line should be a sentence that tells me your favorite food. The final line should tell me your favorite hobby. Then save your text file and exit out of the text editor. e. Write a command to display the contents of the file MyFile.txt to standard output (the screen). f. Copy the file MyFile.txt to directory Files and rename the copy to t_1.txt (There is a way to do this with one command - try to figure it out!) g. Change your working directory to Files. h. Make a copy of t_1.txt with the name t_2.txt (in the same directory). i. Display the contents of the directory Files using the long listing format. j. Delete the file t_1.txt in the directory Files. k. Display the contents of the directory Files. Question 4 (10 points) - Manipulate files using wildcards. Starting from the Files directory you created in Question 3 a. Change your current working directory to COP3353-hw1. (Stay in this directory for the rest of the steps in question 4) b. Create a new directory called assign3 in your current working directory. c. Create 9 new files using ONE COMMAND (in directory COP3353-hw1) named as follows: Test_1.txt Test_2.txt Test_1-1.txt Test_2-1.txt Test_1-2.xtxt Test_2-2.xtxt Test_1-1.bak Test_2-2.bak File_1.bat d. Display a listing of all the files in the current working directory. e. Display a listing of all the files in the current working directory ending in txt using one command. (NOTE: txt is not equal to .txt) f. Display a listing of all the files in the current working directory ending in t using one command. g. Copy all the files containing "t_1" to the directory assign3 using one command. h. Display a listing of the contents of the directory assign3, without navigating to the directory. Question 5 (10 points) - Filenames (relative, absolute) and their paths. Assume Bob is your home directory ( ~ ), and your current working directory is dog. (Note you're no longer performing commands on your account for this question).
(1pt ea) Write the absolute pathnames for: a. Alice b. Felix c. etc d. Tweety (1pt ea) Relative to where you are located (dog directory), write the cd command that would navigate you to the following directories (relative pathname): e. user f. Carl g. Garfield (3pts) Write 3 different ways (using 3 different pathnames, one relative, one absolute, and one that uses ~ ) to navigate with cd to: h. Felixefc user oin I V oBo Alice acr Cat weet
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
