|
1 | | -# terminal |
| 1 | +# **Terminal Navigation Assignment** |
| 2 | + |
| 3 | +## **Objective** |
| 4 | +This assignment will help you practice **essential terminal navigation commands** used in Linux/macOS. |
| 5 | + |
| 6 | +By the end of this assignment, you should be able to: |
| 7 | +- Navigate directories using the terminal. |
| 8 | +- Use commands like `pwd`, `ls`, `cd`, `find`, `cat`, and `grep`. |
| 9 | +- Locate and read files using command-line tools. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## **Assignment Instructions** |
| 14 | + |
| 15 | +### **Step 1: Set Up Your Environment** |
| 16 | +1. Open the **GitHub Codespace** or **your terminal** if working locally. |
| 17 | +2. Verify that your working directory contains the following structure: |
| 18 | + |
| 19 | +/terminal-navigation-assignment |
| 20 | +│── practice-directory/ |
| 21 | +│ ├── folder1/ |
| 22 | +│ │ ├── fileA.txt |
| 23 | +│ ├── folder2/ |
| 24 | +│ │ ├── fileB.txt |
| 25 | +│ ├── fileC.txt |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +### **Step 2: Complete the Following Tasks** |
| 30 | +Use terminal commands to complete each task below. |
| 31 | + |
| 32 | +1. **Print your current working directory (absolute path).** |
| 33 | +```sh |
| 34 | +pwd |
| 35 | + |
| 36 | + 2. List all files and directories inside practice-directory. |
| 37 | + |
| 38 | +ls practice-directory |
| 39 | + |
| 40 | + |
| 41 | + 3. Change into folder1 and verify you are inside it. |
| 42 | + |
| 43 | +cd practice-directory/folder1 |
| 44 | +pwd |
| 45 | + |
| 46 | + |
| 47 | + 4. Display the contents of fileA.txt. |
| 48 | + |
| 49 | +cat fileA.txt |
| 50 | + |
| 51 | + |
| 52 | + 5. Return to the terminal-navigation-assignment root directory in a single command. |
| 53 | + |
| 54 | +cd ../../ |
| 55 | + |
| 56 | + |
| 57 | + 6. Find all .txt files inside practice-directory. |
| 58 | + |
| 59 | +find practice-directory -name "*.txt" |
| 60 | + |
| 61 | + |
| 62 | + 7. Search for the word “Navigation” inside fileC.txt. |
| 63 | + |
| 64 | +grep "Navigation" practice-directory/fileC.txt |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +⸻ |
| 69 | + |
| 70 | +Step 3: Submit Your Work |
| 71 | + 1. Run the test script to verify your work: |
| 72 | + |
| 73 | +bash test_navigation.sh |
| 74 | + |
| 75 | + |
| 76 | + 2. If all tests pass, commit and push your work: |
| 77 | + |
| 78 | +git add . |
| 79 | +git commit -m "Completed Terminal Navigation Assignment" |
| 80 | +git push |
| 81 | + |
| 82 | + |
| 83 | + 3. Your work will be automatically graded using GitHub Actions. |
| 84 | + |
| 85 | +⸻ |
| 86 | + |
| 87 | +Evaluation Criteria |
| 88 | + |
| 89 | +Your assignment will be automatically graded based on: |
| 90 | +✅ Correct execution of each command. |
| 91 | +✅ Accurate directory navigation. |
| 92 | +✅ Successful file searching and reading. |
| 93 | +✅ Passing all tests in test_navigation.sh. |
| 94 | + |
| 95 | +Good luck and happy navigating! 🚀 |
0 commit comments