Posts

Showing posts with the label fold command in Linux

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

The Real Command to Wrap Text in Linux

Image
Here is a command to wrap text in Linux. The wrapping means it prints it in fixed-width column. More importantly, it will not consider spaces between words. The command you need is FOLD.   Fold command in Linux Below, you will find two examples on usage of the FOLD command. These are helpful for your project where you need to write a shell script. Example-1 The following command displays a set of lines with ten characters in each line: x="aa bb cc d e f g h i j kk ll mm nn"  echo $x | fold -10 The output of the preceding code snippet is here: aa bb cc d e f g h i j kk ll m m nn ✏Related: How to Write Recursive Shell Script in Bash Terminal Example-2 As another example, consider the following code snippet: x="The quick brown fox jumps over the fat lazy dog. "  echo $x | fold -10 The output of the preceding code snippet is here: The quick brown fox jumps over the fat l azy dog. ✏References: List of complete ls commands in Linux Keep reading How to Work with Linux