In: Computer Science
Linux-Practise1:
pwd.
What is the output of the above command
nano Linux1
Type the following in the file
Hello world
Save the file
cp Linux1 Linux2
ls
What is the output of the above command
mv Linux2 Linux3
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
pwd.
nano Linux1
Type the following in the file
Hello world
Save the file
cp Linux1 Linux2
ls
mv Linux2 Linux3
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.