|
| 1 | +# Day 06 – Linux Fundamentals: Read and Write Text Files |
| 2 | + |
| 3 | +## Task |
| 4 | +This is a **continuation of Day 05**, but much simpler. |
| 5 | + |
| 6 | +Today’s goal is to **practice basic file read/write** using only fundamental commands. |
| 7 | + |
| 8 | +You will create a small text file and practice: |
| 9 | +- Creating a file |
| 10 | +- Writing text to a file |
| 11 | +- Appending new lines |
| 12 | +- Reading the file back |
| 13 | + |
| 14 | +Keep it basic and repeatable. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Expected Output |
| 19 | +By the end of today, you should have: |
| 20 | + |
| 21 | +- the new created files |
| 22 | +- A markdown file named: |
| 23 | + `file-io-practice.md` |
| 24 | + |
| 25 | +or |
| 26 | + |
| 27 | +- A hand written practice note (Recommended) |
| 28 | + |
| 29 | +Your note should include the commands you ran and what they did. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Guidelines |
| 34 | +Follow these rules while creating your practice note: |
| 35 | + |
| 36 | +- Create a file named `notes.txt` |
| 37 | +- Write 3 lines into the file using **redirection** (`>` and `>>`) |
| 38 | +- Use **`cat`** to read the full file |
| 39 | +- Use **`head`** and **`tail`** to read parts of the file |
| 40 | +- Use **`tee`** once to write and display at the same time |
| 41 | +- Keep it short (8–12 lines total in the file) |
| 42 | + |
| 43 | +Suggested command flow: |
| 44 | +1. `touch notes.txt` |
| 45 | +2. `echo "Line 1" > notes.txt` |
| 46 | +3. `echo "Line 2" >> notes.txt` |
| 47 | +4. `echo "Line 3" | tee -a notes.txt` |
| 48 | +5. `cat notes.txt` |
| 49 | +6. `head -n 2 notes.txt` |
| 50 | +7. `tail -n 2 notes.txt` |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## Resources |
| 55 | +Use these docs to understand the commands: |
| 56 | + |
| 57 | +- `touch` (create an empty file) |
| 58 | +- `cat` (read full file) |
| 59 | +- `head` and `tail` (read parts of a file) |
| 60 | +- `tee` (write and display at the same time) |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## Why This Matters for DevOps |
| 65 | +Reading and writing files is a daily task in DevOps. |
| 66 | + |
| 67 | +Logs, configs, and scripts are all text files. |
| 68 | +If you can handle files quickly, you can debug and automate faster. |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## Submission |
| 73 | +1. Fork this `90DaysOfDevOps` repository |
| 74 | +2. Navigate to the `2026/day-06/` folder |
| 75 | +3. Add your `file-io-practice.md` file |
| 76 | +4. Commit and push your changes to your fork |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Learn in Public |
| 81 | +Share your Day 06 progress on LinkedIn: |
| 82 | + |
| 83 | +- Post 2–3 lines on what you learned about file read/write |
| 84 | +- Share one command you will use often |
| 85 | +- Optional: screenshot of your notes |
| 86 | + |
| 87 | +Use hashtags: |
| 88 | +#90DaysOfDevOps |
| 89 | +#DevOpsKaJosh |
| 90 | +#TrainWithShubham |
| 91 | + |
| 92 | +Happy Learning |
| 93 | +**TrainWithShubham** |
0 commit comments