Posts

Showing posts with the label Tail Command

Featured Post

How to Build CI/CD Pipeline: GitHub to AWS

Image
 Creating a CI/CD pipeline to deploy a project from GitHub to AWS can be done using various AWS services like AWS CodePipeline, AWS CodeBuild, and optionally AWS CodeDeploy or Amazon ECS for application deployment. Below is a high-level guide on how to set up a basic GitHub to AWS pipeline: Prerequisites AWS Account : Ensure access to the AWS account with the necessary permissions. GitHub Repository : Have your application code hosted on GitHub. IAM Roles : Create necessary IAM roles with permissions to interact with AWS services (e.g., CodePipeline, CodeBuild, S3, ECS, etc.). AWS CLI : Install and configure the AWS CLI for easier management of services. Step 1: Create an S3 Bucket for Artifacts AWS CodePipeline requires an S3 bucket to store artifacts (builds, deployments, etc.). Go to the S3 service in the AWS Management Console. Create a new bucket, ensuring it has a unique name. Note the bucket name for later use. Step 2: Set Up AWS CodeBuild CodeBuild will handle the build proces

Tail Command in Linux: A Comprehensive Overview

Image
The tail in Linux is handy command. You can check the last lines of a file in Linux/Unix operating systems. You can use it to display last lines from single file, display last lines from multiple files, display the last entries of log files. Tail Command in Linux During production support the usage of Tail command is helpful since you can check latest logs quickly. Here are the top Tail command examples. #1 Display last lines in a file (Tail file Linux) Here's the tail command that shows last three lines of a file. cat sample.txt | tail -3 It displays last 3 lines of a file. The same command you can use as tail -3 sample.txt #2 Display last lines of multiple files There are three files. sample2.txt, sample3.txt, sample4.txt. The command displays the last 3 lines from all the three files. tail -3 sample[2-4].txt #3 Tail -f option (Tail f Linux) The –f option is to check status of long-running process that is redirecting output to a file. For example, if you invoke the below command