Lab Project 2 Tesah Capers

docx

School

Arizona State University *

*We aren’t endorsed by this school

Course

250

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

6

Uploaded by BrigadierCrocodileMaster638

Report
Tesah Capers LAB PROJECT 2 Part 1: Experiment with some basic shell commands. 1. Open a terminal window on your Linux virtual machine. 2. Notice the shell prompt components: user@hostname:dir$ 3. Use the pwd command to identify your location. 4. Use the cd / command to get to the root of your directory tree structure. 5. Use the cd ~ command to get back to your user’s home directory. 6. Take a screenshot (filename: screenshot_1) of the above activites. a. 7. Clear the shell with the clear command. Part 2: Learn about commands to get help. 1. Use the man ls command to review the ls command. Type q to quit. 2. Use the info ls command to review the ls command. Take note of how this is different from the man command. Type q to quit. 3. Use the help command to find out more information about itself by typing in help help 4. Take a screenshot (filename: screenshot_2) of the above activities.
Tesah Capers a. 5. Clear the shell with the clear command. Part 3: Learn about commands to navigate the directory tree structure while creating files and directories. 1. While in your user’s home directory, use the ls -1 / command to view the contents of the / directory. 2. Take a mental note of which direcotries are part of the Linux Filesystem Hierarchy Standard (FHS) and those that are not (refer back to learning materials for this module). 3. Use the mkdir test1 command to add a new directory in your home directory. 4. Use the cd command to change into the test1 directory that you just created in the previous step. 5. Use touch file1 to create a new empty file in the test1 directory. 6. Use the ls command with a single option (flag) to view the details of file1. (If you can’t remember which option is used to view the details, what can you do to view the available options for that command?). 7. Use rm file1 to delete it. 8. Exit the test1 directory and return to its parent directory. 9. Use rmdir test1 to delete it. 10. Use the mkdir command to add a directory named test2 in your home directory. 11. Copy the /etc/passwd file to the ~/test2 directory so a copy of /etc/passwd is stored at ~/test2/passwd.bak 12. Use one command to verufy that the copy of /etc/passwd was successfully made to ~/test2/passwd.bak while also indicating that it is not empty. The output of this command must consist of only two short lines. 13. Take a screenshot (filename: screenshot_3) of above activities.
Tesah Capers a. 14. Clear the shell with the clear command. PART 4: Learn about commands used to view the contents of files. 1. Use the cat command to review the contents of the ~/test2/passwd.bak 2. Take a screenshot (filename: screenshot_4) of the above activity.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Tesah Capers a. 3. Clear the shell with the clear command. 4. Resize your terminal window to make it half of the height that it was before by dragging the bottom of the window up. 5. Now try step 1 again, but use the less command instead of cat. (use the up and down arrow keys to scroll through the file, type in q, to exit less.) 6. Return your terminal window to its previous height by dragging the bottom of the window down. 7. Now try step 1 again, but use the head command instead of cat. 8. Now try step 1 again, but use the tail command instead of cat. 9. Try steps 7 and 8 again, but add the -n2 option/flag to the head and tail commands and see what happens. 10. Type cat > file1 and enter a single sentence about how you feel about Linux. Hit enter and then type CTRL + d to exit. 11. Type cat file1 to view its contents. 12. Create another file with this command ls -la ~ > file50 13. Append to the end of file50 the contents of ~/test2/passwd.bak using this command cat ~/test2/passwd.bak >> file50
Tesah Capers 14. Review the final contents of file50 your work using the less command. You should remember how to exit less. 15. Search file50 for any lines with the word root by using this command: grep root file50 16. Take a screenshot (filename: screenshot_5) of the above activities. a. 17. Clear the shell with the clear command. PART 5: Try out some new commands! 1. W 2. Who 3. Whoami 4. Cal 5. Data 6. Date +%Y 7. Let linuxage=$(date +%Y)-1991 8. Echo ‘Linux is’ $linuxage ‘years old!’ > birthday 9. Cat birthday
Tesah Capers 10. Cat birthday | wc 11. Env | grep PATH 12. Groups 13. Id 14. Uname -a 15. Hostname 16. Shutdown (before entering this command, be prepared to type in the next command very quickly afterward – within 60 secoonds!) 17. Shutdown -c 18. Take a screenshot (filename: screenshot_6) of the above activities. a.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help