This assignment will help you practice essential terminal navigation commands used in Linux/macOS.
By the end of this assignment, you should be able to:
- Navigate directories using the terminal.
- Use commands like
pwd
,ls
,cd
,find
,cat
, andgrep
. - Locate and read files using command-line tools.
- Open the GitHub Codespace or your terminal if working locally.
- Verify that your working directory contains the following structure:
/terminal-navigation-assignment
│── practice-directory/
│ ├── folder1/
│ │ ├── fileA.txt
│ ├── folder2/
│ │ ├── fileB.txt
│ ├── fileC.txt
Use terminal commands to complete each task below.
- Print your current working directory (absolute path).
pwd
- List all files and directories inside practice-directory.
ls practice-directory
- Change into folder1 and verify you are inside it.
cd practice-directory/folder1
pwd
- Display the contents of fileA.txt.
cat fileA.txt
- Return to the terminal-navigation-assignment root directory in a single command.
cd ../../
- Find all .txt files inside practice-directory.
find practice-directory -name "*.txt"
- Search for the word "Navigation" inside fileC.txt.
grep "Navigation" practice-directory/fileC.txt
- Run the test script to verify your work:
bash test_navigation.sh
- If all tests pass, commit and push your work:
git add .
git commit -m "Completed Terminal Navigation Assignment"
git push
- Your work will be automatically graded using GitHub Actions.
Your assignment will be automatically graded based on: ✅ Correct execution of each command. ✅ Accurate directory navigation. ✅ Successful file searching and reading. ✅ Passing all tests in test_navigation.sh.
Good luck and happy navigating! 🚀