Awk If Statement In this awk tutorial, let us review awk conditional if statements with practical examples. Normally conditional statement checks the condition, before performing any action. If the condition is true action(s) are performed. Similarly action can be performed if the condition is false. Conditional statement starts with the keyword called "if". Awk supports three different kind of if statement. Awk Simple If statement Awk If-Else statement Awk If-Else-If statement awk If Statement Single Action: Simple If statement is used to check the conditions, if the condition returns true, it performs its corresponding action(s). Linux Linux Utilities Bash Development
YUM Commands for Package Management What is YUM? YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems. It was developed and released by Seth Vidal under GPL (General Public License) as an open source, means anyone can allowed to download and access the code to fix bugs and develop customized packages. Linux
Useful tips for Debian based distros Debian bookworm - behavior of more utility has changed I've just ran apt upgrade and apt dist-upgrade and noticed the behavior of more utility has changed. In particular I have to supply -e option in my scripts otherwise it currently presents me with (END) prompt in console. Or when I have alias with more utility, example: alias lf="ls -alFh|more", the output end with (END) prompt in console. Manual says the following: Debian Linux Linux Utilities
How Modify Systemd Unit Files Right Way Location of systemd unit files /lib/systemd/system - The system's copy of unit files are generally kept in this directory. When software installs unit files on the system, this is the location where they are placed by default. /run/systemd/system - Systemd unit files created at run time. This directory takes precedence over the directory with installed service unit files. /etc/systemd/system/ - If you wish to modify the way that a unit functions, the best location to do so is within this directory. Linux
GNU Regex POSIX character classes Character classes are a feature introduced in the POSIX standard. A character class is a special notation for describing lists of characters that have a specific attribute, but the actual characters can vary from country to country and/or from character set to character set. For example, the notion of what is an alphabetic character differs between the United States and France. Linux Linux Utilities Bash
How to remove/delete CTRL-M (^M) characters from text files in Linux and UNIX systems Newline Newline (frequently called line ending, end of line (EOL), line feed, or line break) is a control character or sequence of control characters in a character encoding specification (e.g. ASCII table or EBCDIC ) that is used to signify the end of a line of text and the start of a new one. The concepts of line feed (LF) and carriage return (CR) are closely associated and can be considered either separately or together. Linux
AWK as Grep Structure of AWK programs AWK reads the input a line at a time. A line is scanned for each pattern in the program, and for each pattern that matches, the associated action is executed. — Alfred V. Aho[13] An AWK program is a series of pattern action pairs, written as: BEGIN { # init code goes here } # "body" of the script follows: condition 1 or /pattern-1/ { # action1 - what to do with the line matching the pattern? Linux
Colorize linux programs output Learn how to make your Bash/Shell script colourful and attractive without installing any plugins and configuration. Linux Bash Development
7-bit ASCII Character Codes 7-bit ASCII Character Codes The ASCII table contains letters, numbers, control characters, and other symbols. Each character is assigned a unique 7-bit code. ASCII is an acronym for American Standard Code for Information Interchange. Decimal Octal Hex Binary Value Description Carret notation Escape sequence in C 000 000 00 0000 0000 NUL "null" character ^@ \0 001 001 01 0000 0001 SOH start of header ^A 002 002 02 0000 0010 STX start of text ^B 003 003 03 0000 0011 ETX end of text ^C 004 004 04 0000 0100 EOT end of transmission ^D 005 005 05 0000 0101 ENQ enquiry ^E 006 006 06 0000 0110 ACK acknowledgment ^F 007 007 07 0000 0111 BEL bell ^G \a 008 010 08 0000 1000 BS backspace ^H \b 009 011 09 0000 1001 HT horizontal tab ^I \h 010 012 0A 0000 1010 LF line feed ^J \n 011 013 0B 0000 1011 VT vertical tab ^K \v 012 014 0C 0000 1100 FF form feed ^L \f 013 015 0D 0000 1101 CR carriage return ^M \r 014 016 0E 0000 1110 SO shift out ^N 015 017 0F 0000 1111 SI shift in ^O 016 020 10 0001 0000 DLE data link escape ^P 017 021 11 0001 0001 DC1 device control 1 (XON) ^Q 018 022 12 0001 0010 DC2 device control 2 ^R 019 023 13 0001 0011 DC3 device control 3 (XOFF) ^S 020 024 14 0001 0100 DC4 device control 4 ^T 021 025 15 0001 0101 NAK negative acknowledgement ^U 022 026 16 0001 0110 SYN synchronous idle ^V 023 027 17 0001 0111 ETB end of transmission block ^W 024 030 18 0001 1000 CAN cancel ^X 025 031 19 0001 1001 EM end of medium ^Y 026 032 1A 0001 1010 SUB substitute ^Z 027 033 1B 0001 1011 ESC escape ^[ \e 028 034 1C 0001 1100 FS file separator ^\ 029 035 1D 0001 1101 GS group separator ^] 030 036 1E 0001 1110 RS request to send/record separator ^^ 031 037 1F 0001 1111 US unit separator ^_ 032 040 20 0010 0000 SP space ^? Development Linux Linux Utilities
Certbot - Let's Encrypt certificates on Debian server with Apache webserver How install and use certbot on Debian system, examples how create Let's Encrypt certificates for multiple domains, how handling certbot automatic renewal. It covers a apache2 webserver configuration for using cerbot generated certificates. Setup is made for Debian and debian based linux distributions Linux Debian Security Web Servers
Certbot and Let’s Encrypt CA What is Certbot, cerbots commands and user guide, what is Let's Encrypt Rate Limits. How works cerbot authenticators and installers, certbot commands exmaples Linux Security Web Servers
How Reset root password in MySQL and MariaDB How Reset root password in mysql and mariadb - generic instructions If you assigned a root password in MySQL or MariaDB previously but have forgotten it, you can assign a new password. The following sections provide generic instructions for that apply to any system. On any platform, you can reset the password using the mysql client (but this approach is less secure): Stop the MySQL or MariaDB server ~]$ /etc/init. Databases Linux