A hash collection is a data structure that contains key-value pairs in Go and enables quick lookups, additions, and deletions. The value that corresponds to the key can be accessed by hashing the key into an index. Hash collections in the form of maps have built-in support in Go. Here, a map is a reference type that is declared by using the map keyword, followed by the key type and value type in the format. In tis example, we will use two methods to get keys from a hash collection, in the first example we will use append method to ... Read More
In Golang, we can use a simple indexing method and slicing method to add items to the hash collections. A hash function is used for retrieving and storing the data. In this article are going to see two different examples where we are going to use the above-mentioned methods to add items to a hash collection in go programming language. Syntax func make ([] type, size, capacity) The make function in go language is used to create an array/map it accepts the type of variable to be created, its size and capacity as arguments. Algorithm Import the required ... Read More
Introduction Amazon Web Services (AWS) is one of most popular cloud computing platforms in world. It provides a wide range of services, such as storage, computing, networking, and databases, to name a few. AWS Command Line Interface (CLI) is a powerful tool that allows you to manage your AWS resources using commands in terminal or shell. In this article, we will discuss how to install AWS CLI on Linux, including various sub-headings and examples. Step 1: Check Python Installation Before installing AWS CLI, you need to ensure that Python is installed on your Linux system. Python is a programming ... Read More
Introduction The Unix operating system is known for its powerful command-line interface and an extensive collection of tools. Among these tools, "uniq" command is a popular utility that is used to filter out duplicate lines in text files. This command is often used in conjunction with other command-line tools and shell scripts to manipulate data and automate tasks. In this article, we will explore "uniq" command in detail, including its syntax, options, and examples of its usage. Syntax The syntax of "uniq" command is simple and easy to understand. basic syntax of command is as follows − uniq [options] [input_file] ... Read More
Introduction Awk is a powerful text processing tool that is widely used by developers, system administrators, and analysts to manipulate data in a variety of ways. It is a versatile tool that can process text files, extract data, and transform it into a variety of formats. One of key features of Awk is its ability to process multiple input files at same time, making it ideal for batch processing tasks. In this article, we will explore how to use Awk to process multiple input files and examine several examples of how it can be used in practice. Using Awk with ... Read More
Introduction When working with Linux or any command-line interface, you may come across situations where you need to combine multiple lines of text into a single line. This can be helpful for formatting or readability purposes, and it can also be necessary for certain scripting tasks. In this article, we will discuss several methods for joining multiple lines into one on Linux, including use of command-line tools like sed, awk, and paste. We will provide examples of each method to demonstrate how they can be used in different situations. Method 1: Using "tr" Command One of simplest ways to join ... Read More
Introduction Linux is an open-source operating system that has gained a lot of popularity among developers and system administrators. It offers various powerful tools and commands to manage files, directories, and other resources on system. One such command that comes in handy is tree command, which helps in displaying directory structure of system in a tree-like format. In this article, we will explore tree command and its usage in detail. What is tree command? The tree command is a command-line tool that displays directory structure of a file system in a tree-like format. It shows nested structure of directories, sub-directories, ... Read More
The cd command is one of most fundamental commands in Bash shell. It is used to change current working directory to a specified location. This command is particularly useful when navigating through file system, especially in situations where you need to access files or directories in a different location. In this article, we will explore how to use cd command in Bash scripts. What is cd Command? Before diving into usage of cd command, it is important to understand what it does. cd command is a built-in command in Bash that is used to change current working directory. When you ... Read More
Introduction The vi editor is one of most popular text editors on Linux. It is a command-line-based editor that comes pre-installed on most Linux distributions. Although it may seem daunting to new users, it is a powerful and efficient tool for editing text files. In this guide, we will cover basics of using vi editor on Linux. Opening vi Editor To open vi editor, open a terminal window and type "vi" followed by name of file you want to edit. For example, to edit a file called "example.txt", type − vi example.txt If file does not exist, vi will ... Read More
Introduction Bash Fork Bomb is a type of denial of service (DoS) attack that can crash or freeze a Linux system by overwhelming its resources. attack uses a malicious script that creates a large number of child processes, causing system to run out of available resources, such as memory or CPU time. These child processes then spawn more child processes, and cycle continues until system is unable to respond. Preventing Bash Fork Bombs in Linux is essential for system administrators to ensure stability and availability of their systems. In this article, we will explore what a Bash Fork Bomb is, ... Read More