Category bash

sed delete all lines after

Objective: Prep dev httpd.conf for production Tasks: Remove jenkins virtual host entry (which starts with a comment line “#Start Jenkins”) Replace .dev with nothing (ex: www.dev.example.com becomes www.example.com) Replace debug with error (ex: Loglevel debug becomes Loglevel error) Sed to…

redhat add multiple users

useradd script to add multiple users to a system and force them to change their password upon login try the following script: Redhat # for name in someuser anotheruser yetanotheruser; do useradd $name; echo ‘password’ | passwd –stdin $name; chage…

bash diff alternative

How to setup a bash diff alternative nano -w /usr/bin/diff2 Copy and paste the below in to /usr/bin/diff2 #!/bin/bash # # name: diff2.sh # usage: . file1 file2 # To make available to whole system copy to /usr/local/bin # and…