Question: Hello please answer the following linux question for me thank you! 1. Open up a terminal. Type pwd to confirm your working directory is something

Hello please answer the following linux question for me thank you!

1. Open up a terminal. Type pwd to confirm your working directory is something like /home/cct. Then type ls to display the list of directories. Now we want to create a directory to put some files in. Type the following commands cct@cct-vm:~$ mkdir Lab2 cct@cct-vm:~$ ls If everything goes well, you should see a new directory called Lab2.

2. To get into this new directory, use the following command cct@cct-vm:~$ cd Lab2 You can type pwd to find out where you are. The pwd command tells you your present working directory. Now that you are inside Lab2, create 2 more directories inside Lab2 (ex: Apple and Orange). We can enter and exit from a directory using cd command. Assuming you are currently in /Lab2 (use pwd to check), you can enter into the Orange directory by doing a cd Orange and get out of the Orange back to Lab2 by typing cd ../.

Question 1. Try to create a new directory with the same name as an existing one. What is the error message you see?

3. Next, we want to put stuff into the directories you have created. Type this command: cct@cct-vm:~/Lab2$ echo Hello world > hello.file You can copy hello.file into a directory by using the cp command. Assuming you are currently in the Lab2 directory, copying the file into a directory called Orange, the command is: cct@cct-vm:~/Lab2$ cp hello.file Orange/ If you want to move the file (rather than copying it), the command to use is mv. 4. To delete a file, use the rm command. To delete a directory, you will need to the -r flag cct@cct-vm:~/Lab2$ rm r Orange

Question 2. Try deleting a file that does not exist. What happens?

Question 3. Some of the commands we used today are: pwd, mkdir, cd, ls, cp and mv. Explain in your words what each command does.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!