Skip to main content

Command Palette

Search for a command to run...

Day 8 - Logs and Text Processing in Linux

grep, cut, awk, sed, less, tail, and head in action

Published
β€’1 min read
Day 8 - Logs and Text Processing in Linux

On Day 8, I explored the powerful world of Linux log files and text processing commands. These are essential for DevOps, sysadmin tasks, debugging, and automation.

πŸ” What I Learned Today

πŸ”Ή Working with Logs

  • Viewed and followed log output:

        tail -f /var/log/messages
        tail -f /var/log/yum.log
        less +F yum.log
    
  • Navigated configuration files:

      grep -i firewall anaconda-ks.cfg
      grep -R SELINUX /etc/*
      vim /etc/selinux/config
    

    Text Exploration Tools

  • Viewers: cat, less, more, head, tail

  • Search & Filter:

grep -i firewall anaconda-ks.cfg
grep -R selinux /etc/
  • Field Extraction:

      cut -d: -f1 /etc/passwd   # usernames
      cut -d: -f3 /etc/passwd   # UIDs
      awk -F':' '{print $1}' /etc/passwd
    

    Text Manipulation with sed

    • Edited files inline:

        sed -i 's/coronavirus/covid19/g' samplefile.txt
        sed -i 's/covid19/nothing/g' samplefile.txt
      

      Key Learnings

      • How to monitor live log output (tail -f)

      • Use cut, awk, and grep to extract structured text

      • Automate bulk text replacements with sed

      • Investigated system config files (/etc/passwd, anaconda-ks.cfg, SELinux configs)


🧠 This knowledge will help in:

  • Reading audit logs

  • Debugging boot issues

  • Managing users and services

  • Automating file edits in pipelines

DevOps overview as a beginner

Part 8 of 50

Sharing my journey of learning DevOps as a beginner β€” covering essential tools, cloud setup, CI/CD, Docker, monitoring, and more, step by step with practical examples.

Up next

Day 9 – Linux Output Redirection and Error Logs

Practice with sysinfo scripts, redirection, and locate/find/grep