Vi is a text editor originally created for Unix-based systems and is widely used in Linux environments. It is a powerful, lightweight, and versatile editor that operates directly within a terminal window. Vi is known for its efficiency and keyboard-based editing commands, making it popular among system administrators, …
Read MoreUser management useradd [USERNAME] - Add new user useradd -G [GROUPNAME][username]- Add new user in group passwd [USERNAME] - User account is locked until you set a password with the passwd command usermod -a -G [GROUPNAME][username] - Add user in group userdel [USERNAME] - Remove the existing user cat /etc/passwd | …
Read MoreCrontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times Commands crontab -e - Edit your crontab file, or create one if it doesn’t already exist. crontab -l - Display your crontab file. crontab -r - Remove your crontab file. crontab -v - Display the last time you …
Read Morebasic 'find file' commands 1find / -name foo.txt -type f -print # full command 2find / -name foo.txt -type f # -print isn't necessary 3find / -name foo.txt # don't have to specify "type==file" 4find . -name foo.txt # search under the current dir 5find . -name "foo.*" # wildcard 6find . -name …
Read MoreOptions Description -c This prints only a count of the lines that match a pattern -h Display the matched lines, but do not display the filenames. -i Ignores, case for matching -l Displays list of a filenames only. -n Display the matched lines and their line numbers. -v This prints out all the lines that do not matches …
Read MoreShebang On Linux, a shebang #! is a special line at the beginning of a script that tells the operating system which interpreter to use when executing the script. This line, also known as a “sharp-exclamation”, “sha-bang”, “hash-bang”, or “pound-bang”, is the first line of a dash and starts with #! followed by the path …
Read MorePresented below is an illustrative shell script for managing MySQL databases. This script facilitates the creation of databases and the establishment of users with customized access permissions. Please feel free to utilize this script wherever it may be required. Example 1#!/bin/bash 2# VARIABLES 3# 4_bold=$(tput bold) …
Read MoreProvided below is an example script designed to dynamically back up a MySQL database hosted within a Docker environment. The backup is subsequently pushed to an AWS S3 bucket. Feel free to utilize this script for your database backup requirements. MySQL Backup and Push to S3 Bucket 1#!/bin/bash 2 …
Read MoreBelow is an example of a shell script designed to manage users in Linux. This script includes various functionalities such as creating new users, listing existing users, resetting passwords, locking/unlocking users, backing up user data, deleting users, and more. Feel free to review and utilize this script as needed. …
Read MoreAWK is a line-oriented language basically used to manipulating data and generate reports. awk script no required any compiler to compile. In awk we use variables, numeric functions, string function and logical operators. Awk is abbreviated from the names of the developers – Aho, Weinberger, and Kernighan. An awk …
Read More