DEV Community

Cover image for Linux Learning Journey – Day 4: File Handling & Text Processing in Practice 🐧
Avinash wagh
Avinash wagh

Posted on

Linux Learning Journey – Day 4: File Handling & Text Processing in Practice 🐧

Day 4 of my Linux learning journey was focused on hands-on practice with core file handling and text processing commands that are commonly used in daily Linux, cloud, and DevOps work.

I learned and practiced several new commands today, focusing on how files and text are created, edited, processed, and compared directly from the terminal.

πŸ”Ή Writing Output to Files (echo, tee)

To create a file and write content while displaying it on the terminal:

echo "Hello dosto... How are you..?" | tee Myfile.txt

This approach is useful when you want to log output without hiding it from the terminal.

πŸ”Ή Editing Files with vi

To modify file content:

vi Myfile.txt

Practiced key vi operations:

  • Insert mode (i)
  • Save (:w)
  • Save & exit (:wq)
  • Exit without saving (:q!)

These skills are critical since vi is available on almost all Linux servers.

πŸ”Ή Sorting Text Data (sort)

To sort lines alphabetically:

sort Myfile.txt
sort Mail.txt

Commonly used when working with:

  • Email lists
  • Logs
  • Structured text data

πŸ”Ή Extracting Specific Characters (cut)

To extract selected bytes from text:

cut -b 1-3 Mail.txt

Helpful for parsing usernames, IDs, or fixed-format text files.

πŸ”Ή Comparing Files (diff)

To identify differences between two files:

diff Myfile.txt Mail.txt

This command is widely used for:

  • Comparing configuration files
  • Auditing changes
  • Troubleshooting issues

πŸ“Œ Day 4 Key Learnings

  • Linux text utilities are powerful when combined
  • Small commands solve big problems
  • File and text handling is the foundation of cloud & DevOps automation

πŸš€ Reflection

Day 4 was about confidence through repetition.
Practicing these commands made me more comfortable working directly on the terminalβ€”exactly what’s needed in real server environments.

On to Day 5 with more Linux learning πŸ§πŸš€

Top comments (0)