×

How-to articles, tricks, and solutions about Linux


AWK Features Explained with Examples

This article covers the usage of the AWK command in Linux.  In fact, AWK can use to manipulate text in documents or perform specific functions.


What Operations can AWK do ?

  • Scanning files line by line.
  • Splitting each input line into fields.
  • Comparing input lines and fields to patterns.
  • Performing specified actions on matching lines.


AWK Command Usefulness includes:

  • Changing data files.
  • Producing formatted reports.


What is AWK Syntax ?

It is given below:

$ awk options 'selection _criteria {action }' input-file > output-file

Bash "If String Equals" Comparison - Complete guide ?

This article covers the equality comparison operator for the strings in Bash. In fact, you will be able to realize that the strings can be compared in Bash very easily irrespective of their length.

Two strings are equal when they have the same length and contain the same sequence of characters.

6 Best Text Editors for Linux

This article covers the best text editor for Linux. In fact, some Linux editors add extra features or an easy-to-use interface.


The Types of Text Editor in Linux are:

  • Command-line text editors: A good example is Vim, which gives you the option of jumping into the editor from the command line. System admins will find this very useful when editing configuration files.
  • Graphical user interface (GUI) text editors: This type of text editor features a GUI but cannot be used from the command line.

Disable the Network Interface on Boot in CentOS 8 - Step by step guide ?

This article covers the process of disabling the network interface, the use of the network interface, and the working of the network interface. In fact, in some situations, you might need any one of them to be disabled temporarily so that the other one can work properly. 


How do I delete an ifconfig interface ?

To delete an alias interface use:

$ ifconfig eth0:0 down 

Note: for every scope (i.e. same net with address/netmask combination) all aliases are deleted, if you delete the first (primary). 

'ifconfig eth0:0 up' flag causes the interface to be activated.


How do I restart NetworkManager in AlmaLinux ?

1. You can run the following command to restart the server networking service:

# nmcli networking off 
# nmcli networking on 

or 

# systemctl restart NetworkManager

2. Once this is done, use the following command to check the server network status:

# nmcli -o 

or

# systemctl status NetworkManager

DMIDECODE Command in Linux - How to use it ?

This article covers the usage of the DMIDECODE command in Linux. In fact, the "dmidecode" command in Linux is used for extracting all the hardware-related information of your system. 

Dmidecode stands for DMI (Desktop Management Interface) table decoder, as the name suggests it reads the data from DMI table and represents to us in human readable format. DMI table holds the system hardware details like BIOS, Serial Number, RAM(DIMMs) and CPU details etc, apart from this dmidecode can also retrieve details about the maximum system supported configuration (like DIMMs & Processors etc).

Compare Numbers in a Bash Script - How to do it ?

This article covers the methods of comparing two numbers in Bash. 


Comparison Operators for Numbers:

  • num1 -eq num2: check if 1st  number is equal to 2nd number.
  • num1 -ge num2: checks if 1st  number  is greater than or equal to 2nd number.
  • num1 -gt num2: checks if 1st  number is greater than 2nd number.
  • num1 -le num2: checks if 1st number is less than or equal to 2nd number.
  • num1 -lt num2: checks if 1st  number  is less than 2nd number.
  • num1 -ne num2: checks if 1st  number  is not equal to 2nd number.