?? Mastering Linux Filters, Redirection, and Piping in DevOps! ?? (Linux 4#)

?? Mastering Linux Filters, Redirection, and Piping in DevOps! ?? (Linux 4#)


As I continue expanding my skillset in DevOps, I've been deep-diving into Linux commands, filters, and I/O redirection — all critical tools for managing data flows and system outputs efficiently! ???

?? Grep is my go-to for finding text patterns in files. Here are some useful commands:


# Find the line that contains the word "root" from /etc/passwd
grep "root" /etc/passwd
# Ignore case sensitivity (Root ≠ root)
grep -i "root" /etc/passwd
# Display lines that do not contain the word "root"
grep -v "root" /etc/passwd        

?? I/O Redirection allows for seamless data handling:

# Create a file with content
echo "Kubernetes is a great tech tool" > devopstools.txt
# Search for "tech" and replace it with "tools", redirecting the output to a new file
sed 's/tech/tools/g' devopstools.txt > newfile.txt
# Append output to the same file
echo "Docker is another powerful tool" >> newfile.txt
# Redirect only errors to a file
command 2>> error_log.txt
# Redirect all output (stdout and stderr) to a file
command &>> output_log.txt        

?? Piping (|) lets you chain commands together for efficient workflows:

# Display the first 5 lines of the /etc/passwd file and search for users
head -n 5 /etc/passwd | grep "user"

# Use less to display the contents of a file page-wise
cat newfile.txt | less
        


Mastering these core skills is key to deploying, troubleshooting, and managing systems in cloud environments like AWS. And yes, it's all part of my journey to mastering DevOps tools like Docker, Kubernetes, Jenkins, and beyond! ???? #Linux #DevOps #CloudComputing #AWS #SystemAdministration #Kubernetes #Docker #Automation #SysAdmin #ContinuousIntegration #DevOpsJourne

要查看或添加评论,请登录

Krishantha Bandara的更多文章

  • ?? Excited to Share My DevOps Course Project: Building a Multi-Tier Application Environment!??

    ?? Excited to Share My DevOps Course Project: Building a Multi-Tier Application Environment!??

    Introduction In today’s fast-paced digital landscape, the ability to deliver applications quickly and reliably is…

  • ?? Setting Up Multiple Vagrant VMs for a Local Development Environment ??

    ?? Setting Up Multiple Vagrant VMs for a Local Development Environment ??

    If you’re looking to create and manage multiple virtual machines (VMs) in a local development setup, Vagrant is a…

  • ?? Deploying WordPress on an Ubuntu Server ??

    ?? Deploying WordPress on an Ubuntu Server ??

    Deploying WordPress on an Ubuntu server is a powerful way to manage your website independently. Here’s a step-by-step…

  • ?? Understanding Linux Users & Groups (Linux 04) ??

    ?? Understanding Linux Users & Groups (Linux 04) ??

    Linux is a multi-user operating system, which means it’s built to handle multiple users securely and efficiently. One…

  • VIM EDITOR (Linux #3)

    VIM EDITOR (Linux #3)

    ?? Mastering Vim Editor: The Ultimate Tool for Developers! ?? If you’re serious about writing clean, efficient code…

  • Basics of Linux Commands (Linux #2)

    Basics of Linux Commands (Linux #2)

    ?? Mastering the Basics of Linux Commands ??? If you’re working in tech, especially in DevOps or system administration,…

  • Introduction to Linux #1

    Introduction to Linux #1

    ?? Unlock the Power of Open Source with Linux! ???? In today's tech-driven world, understanding Linux can open up a…

  • Vagrant Cloud

    Vagrant Cloud

    ?? Streamline Your Development Environment with Vagrant Cloud! ????? For developers looking to efficiently manage and…

  • Chocolatey CLI

    Chocolatey CLI

    ?? Boost Your Productivity with Chocolatey CLI – The Ultimate Windows Package Manager! ???? If you're managing software…

社区洞察

其他会员也浏览了