Question

In: Computer Science

Linux-Practise1: Run the following commands (Print working directory) pwd. What is the output of the above...

Linux-Practise1:

  1. Run the following commands
  1. (Print working directory)

pwd.

What is the output of the above command

  1. Create a file named Linux1

nano Linux1

Type the following in the file

Hello world

Save the file

  1. Create a copy of the file

cp Linux1 Linux2

  1. view the listing of the files in the directory

           ls

What is the output of the above command

  1. rename the file

mv Linux2 Linux3

  1. view the listing of the files in the directory

           ls

What is the output of the above command

  

nano

1. Log in to Linux using your user account name and password.

2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens.

3. Enter the pwd command to display your current working directory. Because you have just logged in, this should display your home directory.

4. Create a new subdirectory within your home directory using the command mkdir archive.

5. Change to the new subdirectory you just created by entering cd archive.

6. Create a new file named report using this command: nano report.

7. Enter ls -l to view a detailed file listing of the files in the archive subdirectory. Can you see the size of the report file? What is the file size.

8.Change the name of the report file to oldreport using this command: mv report oldreport

9.   Use the ls command to verify that the file report is no longer there—it has been renamed as oldreport.

10. Copy the oldreport file, making a second copy of the file in the same directory using this command: cp oldreport oldreport2

11. Move both of these files to your home directory using this command: mv * ..

12. Enter the pwd command to check that your current working directory is still the archive subdirectory of your home directory.

13. Use a relative path to remove one of the files from your home directory: rm ../oldreport

14. Confirm the deletion by typing “y” when prompted.

15. List all the files in the current directory: ls

16. Change back to your home directory: cd

17. Since the archive subdirectory is empty, you can use the rmdir command to delete it: rmdir archive

18. Use ls -l to check the contents of your home directory. You should see the oldreport2 file with a size of zero.

PLEASE HELP

Solutions

Expert Solution

  1. (Print working directory)

pwd.

  1. Create a file named Linux1

nano Linux1

Type the following in the file

Hello world

Save the file

  1. Create a copy of the file

cp Linux1 Linux2

  1. view the listing of the files in the directory

           ls

  1. rename the file

mv Linux2 Linux3

  1. view the listing of the files in the directory

           ls

nano

1. Log in to Linux using your user account name and password.

2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens.

3. Enter the pwd command to display your current working directory. Because you have just logged in, this should display your home directory.

4. Create a new subdirectory within your home directory using the command mkdir archive.

5. Change to the new subdirectory you just created by entering cd archive.

6. Create a new file named report using this command: nano report.

7. Enter ls -l to view a detailed file listing of the files in the archive subdirectory. Can you see the size of the report file? What is the file size.

8.Change the name of the report file to oldreport using this command: mv report oldreport

9.   Use the ls command to verify that the file report is no longer there—it has been renamed as oldreport.

10. Copy the oldreport file, making a second copy of the file in the same directory using this command: cp oldreport oldreport2

11. Move both of these files to your home directory using this command: mv * ..

12. Enter the pwd command to check that your current working directory is still the archive subdirectory of your home directory.

13. Use a relative path to remove one of the files from your home directory: rm ../oldreport

14. Confirm the deletion by typing “y” when prompted.

15. List all the files in the current directory: ls

16. Change back to your home directory: cd

17. Since the archive subdirectory is empty, you can use the rmdir command to delete it: rmdir archive

18. Use ls -l to check the contents of your home directory. You should see the oldreport2 file with a size of zero.

All the commands were execute on Linux OS. Feel free to ask nay doubts or if you require any modifications, please comment.

If you have any doubts, leave a comment below before rating. I'll be happy to assist you further.

Do UPVOTE this as I have put a lot of EFFORT in answering this question. It really helps me.


Related Solutions

Use Kali Linux Commands to show me the following: 1. Who are you? 2. Change directory...
Use Kali Linux Commands to show me the following: 1. Who are you? 2. Change directory to Downloads 3. Make a new directory 4. Make a new text file under your name (Ghada.txt) 5. Write a paragraph about Cyber security (4 to 5 sentences) >>simply open the file and write inside it 6. Change the permission to be 764 7. Open the file but with a cyber security match Show me each and every step with figure b. Enter into...
Unix / Linux 31. Given the first two commands, what is the expected output for the...
Unix / Linux 31. Given the first two commands, what is the expected output for the third command? (single quotes) $ echo * a b c $ x=* $ echo '$x' 32. Given the first two commands, what is the expected output for the third command? (Single quotes inside of double quotes) $ echo * a b c $ x=* $ echo "'$x'" 33. Given the first two commands, what is the expected output for the third command? (double quotes...
Unix/Linux Turn in the following commands and any output from the commands. 1) ll to show the original 3 files
Unix/LinuxTurn in the following commands and any output from the commands.1) ll to show the original 3 files2) run the tar command to stuff three files3) ll to show the 'tar archive'4) mkdir newdir to create a new directory to unstuff the 'tar archive'
Linux Question: Describe how you created above file and its contents in VI. a) Bash/VI commands:...
Linux Question: Describe how you created above file and its contents in VI. a) Bash/VI commands: 20pts; b) Non-brute-force solution: 10pts). Note: Brute-force solution means that entering characters one by one Install JDK 1.8 by the following command: $ sudo dnf –y install java-1.8.0-openjdk-devel.x86_64 Use VI to create a file “YourFirstNameHomework.java” (e.g., “MollyHomework.java”) and add the following contents into it. (grading details: file name format:10 pts, a screenshot of the file content in the VI environment: 10pts, paragraphs: 10pts, empty...
a) Observe the following Linux commands and work out what each command does: 1) $ ls...
a) Observe the following Linux commands and work out what each command does: 1) $ ls –al 2) $ /etc/profile 3) $ chmod 200 final_assignment.txt b) Consider a scenario where Bob has downloaded his messages to the local machine with an access of POP3, he can create mail folders and move the downloaded messages into the folders. Bob can then delete messages, move messages across folders, and search for messages (by sender name or subject). But this paradigm—namely, folders and...
QUESTION 1 Match the following LINUX/UNIX commands with what they do. du    whereis users who...
QUESTION 1 Match the following LINUX/UNIX commands with what they do. du    whereis users who am i A. display a compact list of users currently logged in B. locate the binary, source, and manual page files for a command C. summarize disk usage D. who am i currently logged in as on the Linux server. QUESTION 2 What rm command option (flag) would you use to remove a file that begins with a - (hyphen)? -f -p --   ...
Operating Systems class Complete the following work with Linux commands and submit the screenshot. 1.Install a...
Operating Systems class Complete the following work with Linux commands and submit the screenshot. 1.Install a virtual machine with Lubuntu 2.Log in and display the content of your home directory 3.Create a directory called homework under your home directory and navigate to homework directory 4.Create a file called newfile under homework directory (this can be done by Leafpad) 5.Copy the file newfile to tempfile, then rename tempfile to myfile and delete newfile 6.Display the content of myfile
linux Using the grep or egrep commands, what would be the full command (including regular expression)...
linux Using the grep or egrep commands, what would be the full command (including regular expression) to view only the lines in the file /boot/grub/grub.cfg that DO NOT begin with a hashtag (the # sign). In other words, what would be the command to print all the lines in this file that do not begin with this character.
1. What command is used to change the current working directory at the command line?
1. What command is used to change the current working directory at the command line?
Questions: Explain the following Linux commands Show your work examples/outcome. 1. command used to locate /Home/...
Questions: Explain the following Linux commands Show your work examples/outcome. 1. command used to locate /Home/ Directory…show the outcome 2. command used for October 2020 3. mv command and cat command 4. commands used- move to parent directory? 5. Explain why command is used ls -R?   What is the meaning of -R ? 6. Explain and describe two examples of how the touch command. 7. Explain what is the outcome of the commands ls -C ? 8. Explain command echo....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT