“
You can use user data scripts and cloud-init directives or AWS OpsWorks lifecycle events to automatically set up new EC2 instances.[6] You can use simple scripts, configuration management tools like Chef or Puppet. AWS OpsWorks natively supports Chef recipes or Bash/PowerShell scripts. In addition, through custom scripts and the AWS APIs, or through the use of AWS CloudFormation support for AWS Lambda-backed custom resources
”
”
Amazon We Services (Architecting for the AWS Cloud: Best Practices (AWS Whitepaper))
“
Convert Text Files from Windows Format to Linux Format and Vice-Versa $ dos2unix $ unix2dos Sooner or later you're going to be sent a file or download one that uses a pair of CR (carriage return) and LF (line feed) characters to terminate lines in the file. Those type of files are Windows/DOS formatted. Unix-like operating systems simply use the LF character to terminate a line. Sometimes this can cause issues. To convert the file to a unix-like format, use dos2unix. To examine the line termination characters use "cat -A" or the "file" command. $
”
”
Jason Cannon (Command Line Kung Fu: Bash Scripting Tricks, Linux Shell Programming Tips, and Bash One-liners)
“
Creating a Simple Installation Script Create a script to install a list of software packages: Open a new file with a .sh extension: nano install-software.sh Add the following lines to the file: #!/bin/bash sudo apt update sudo apt install -y gimp vlc firefox Save and close the file (Ctrl+O, then Ctrl+X). Make the script executable: chmod +x install-software.sh Run the script: ./install-software.sh Final Thoughts
”
”
INFORMAGIC GORDON (Mastering Ubuntu 24.04: The Ultimate Technical Guide to Linux Administration: Ubuntu 24.04 LTS "Noble Numbat")
“
Strip out Comments and Blank Lines $ grep -E -v "^#|^$" file
”
”
Jason Cannon (Command Line Kung Fu: Bash Scripting Tricks, Linux Shell Programming Tips, and Bash One-liners)
“
Files by Date with Ease $ alias d='date +%F' By using the date format
”
”
Jason Cannon (Command Line Kung Fu: Bash Scripting Tricks, Linux Shell Programming Tips, and Bash One-liners)