|
| 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 | +``` |
| 20 | +/terminal-navigation-assignment |
| 21 | +│── practice-directory/ |
| 22 | +│ ├── folder1/ |
| 23 | +│ │ ├── fileA.txt |
| 24 | +│ ├── folder2/ |
| 25 | +│ │ ├── fileB.txt |
| 26 | +│ ├── fileC.txt |
| 27 | +``` |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +### Step 2: Complete the Following Tasks |
| 32 | +Use terminal commands to complete each task below. |
| 33 | + |
| 34 | +1. **Print your current working directory (absolute path).** |
| 35 | +```sh |
| 36 | +pwd |
| 37 | +``` |
| 38 | + |
| 39 | +2. **List all files and directories inside practice-directory.** |
| 40 | +```sh |
| 41 | +ls practice-directory |
| 42 | +``` |
| 43 | + |
| 44 | +3. **Change into folder1 and verify you are inside it.** |
| 45 | +```sh |
| 46 | +cd practice-directory/folder1 |
| 47 | +pwd |
| 48 | +``` |
| 49 | + |
| 50 | +4. **Display the contents of fileA.txt.** |
| 51 | +```sh |
| 52 | +cat fileA.txt |
| 53 | +``` |
| 54 | + |
| 55 | +5. **Return to the terminal-navigation-assignment root directory in a single command.** |
| 56 | +```sh |
| 57 | +cd ../../ |
| 58 | +``` |
| 59 | + |
| 60 | +6. **Find all .txt files inside practice-directory.** |
| 61 | +```sh |
| 62 | +find practice-directory -name "*.txt" |
| 63 | +``` |
| 64 | + |
| 65 | +7. **Search for the word "Navigation" inside fileC.txt.** |
| 66 | +```sh |
| 67 | +grep "Navigation" practice-directory/fileC.txt |
| 68 | +``` |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +### Step 3: Submit Your Work |
| 73 | +1. Run the test script to verify your work: |
| 74 | +```sh |
| 75 | +bash test_navigation.sh |
| 76 | +``` |
| 77 | + |
| 78 | +2. If all tests pass, commit and push your work: |
| 79 | +```sh |
| 80 | +git add . |
| 81 | +git commit -m "Completed Terminal Navigation Assignment" |
| 82 | +git push |
| 83 | +``` |
| 84 | + |
| 85 | +3. Your work will be automatically graded using GitHub Actions. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Evaluation Criteria |
| 90 | + |
| 91 | +Your assignment will be automatically graded based on: |
| 92 | +✅ Correct execution of each command. |
| 93 | +✅ Accurate directory navigation. |
| 94 | +✅ Successful file searching and reading. |
| 95 | +✅ Passing all tests in test_navigation.sh. |
| 96 | + |
| 97 | +Good luck and happy navigating! 🚀 |
0 commit comments