For my small personal projects, I usually use Slack as a central notification and logging system to help me keep track of the state of my applications. Below is a simple bash function that I use a lot in many of my bash scripts in order to send a notification to a Slack channel: ####### Send notification messages to a Slack channel by using Slack webhook# # input parameters:# $1 - message level: 'INFO' | 'WARN' | 'ERROR'# $2 - pretext# $3 - main text######SLACK_WEBHOOK_URL=xxx SLACK_CHANNEL=x...| Tech Notes from Steven
In the last post, I talked about command line tools that I use very often for search files. In this post, I will talk about command line tools for manipulating files or text content. Don’t forget to use man command to find detailed usage of a command. The following are commands that I use often to manipulate the content of a file or text input: echodisplay a line of text catconcatenate files and print on the standard output sedstream editor for filtering and transforming text sortsort lines...| Tech Notes from Steven
The command line utilities that I use most for searching/finding files in Linux operating systems are: findsearch for files in a directory grepprint lines matching a pattern locatefind files by name find The basic format of a find command is: find [location] [criteria] [actions] Some common examples are listed below: Find files by some name pattern: find /etc -name"*.conf" Find files by size find /var/log -size +1M There are other really useful filter options like: -empty, -newer, -perm, -typ...| Tech Notes from Steven
Creating users in Linux/Unix is a straightforward task. However, adding multiple users across multiple servers can be a time-consuming task, so you can automate this with a shell script to … The post How to Create Users using Shell Script in Linux first appeared on 2DayGeek.| 2DayGeek
It is a best practice to backup a configuration file before performing any activity on a Linux system, which helps you to compare the configuration files in case of any … The post How to Backup Configuration Files on Remote Linux System first appeared on 2DayGeek.| 2DayGeek
In this tutorial, we’ll show you how to check LUN presented from SAN with underlying OS disk, LV Name, VG Name and associated Filesystem on Linux.| 2DayGeek