Skip to content

Commit 70e35fb

Browse files
update code
1 parent e1f9e83 commit 70e35fb

File tree

3 files changed

+126
-11
lines changed

3 files changed

+126
-11
lines changed

.github/workflows/autograde.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
name: Autograding Navigation Assignment
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
permissions:
9+
checks: write
10+
actions: read
11+
contents: read
412

513
jobs:
6-
test:
14+
run-navigation-tests:
715
runs-on: ubuntu-latest
16+
if: github.actor != 'github-classroom[bot]' # Prevents bot-triggered runs
817
steps:
918
- name: Checkout repository
10-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
20+
21+
- name: Make test script executable
22+
run: chmod +x test_navigation.sh
23+
24+
- name: Run Navigation Test Script
25+
run: bash test_navigation.sh
1126

12-
- name: Run Navigation Tests
13-
run: bash test_navigation.sh
27+
- name: Autograding Reporter
28+
uses: classroom-resources/autograding-grading-reporter@v1
29+
with:
30+
runners: terminal-navigation-test

.github/workflows/classroom.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: Autograding Tests
1+
name: Autograding Terminal Navigation Tests
22

33
on:
44
push:
5+
pull_request:
56
workflow_dispatch:
67
repository_dispatch:
78

@@ -13,15 +14,18 @@ permissions:
1314
jobs:
1415
run-autograding-tests:
1516
runs-on: ubuntu-latest
16-
if: github.actor != 'github-classroom[bot]'
17+
if: github.actor != 'github-classroom[bot]' # Prevents bot-triggered runs
1718
steps:
18-
- name: Checkout code
19+
- name: Checkout repository
1920
uses: actions/checkout@v4
2021

22+
- name: Make test script executable
23+
run: chmod +x test_navigation.sh
24+
2125
- name: Run Navigation Test Script
22-
run: bash test_navigation.sh # Runs the custom test script
26+
run: bash test_navigation.sh # Executes the student’s test script
2327

2428
- name: Autograding Reporter
2529
uses: classroom-resources/autograding-grading-reporter@v1
2630
with:
27-
runners: navigation-test
31+
runners: terminal-navigation-test

README.md

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,95 @@
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

Comments
 (0)