Author: Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Deleting the last few commits from a Git repository is a relatively simple process that can be accomplished with a few simple commands. In this guide, we will explain how to delete the last few commits from a git repository, as well as discuss why this might be necessary. We will also provide step-by-step instructions for removing the last few commits from a repository, as well as common issues that may arise in the process. By the end of this guide, you should have a good understanding of how to delete the last few commits from a Git repository. Delete…

Read More

In Bash, you can store the standard error output of a command to a variable by using the `2>&1` operator and the `$()` command substitution syntax. Here `2>` redirects the error message to &1`, that represent to standard output. In the case of bash shell works as the standard output device. For example, to store the standard error output of the `ls` command to a variable named errors, you can use the following command: errors=$(ls non-existent-file 2>&1) Alternatively, you can use the `$?` special parameter to store the exit status of a command to a variable. The exit status is…

Read More

Zsh, or the Z Shell, is a powerful and flexible command-line shell for Unix-like operating systems, including Linux and macOS. It offers many features and improvements over the default bash shell, including improved command completion, spelling correction, and customizable prompts. In this article, we will learn how to install and configure Zsh on Ubuntu and Debian systems. Some of the benefits of using ZSH over Bash include: Enhanced command completion: ZSH offers better command completion than Bash, including the ability to use tab completion for options and arguments. More powerful globbing: ZSH has a more powerful globbing (wildcard matching) system…

Read More

Finding large files in Linux can be useful for a variety of purposes, such as identifying files that are taking up a lot of space on your system or files that may not be necessary and can be deleted. There are several different commands and tools that you can use to find large files in Linux. Using the `find` command A find command is a powerful tool for searching for files on your system. It can be used to find files based on various criteria, such as file name, size, ownership, and permissions. To find large files in Linux using…

Read More

Bash is one of the most popular shells and is used by many Linux users. One of the great things you can do with Bash is removed duplicate lines from files. It’s a great way to declutter a file and make it look cleaner and more organized. This can be done with a simple command in the Bash shell. All you have to do is type in the command “sort -u” followed by the name of the file. This will take the file and sort the content, then use the command “uniq” to remove all duplicates. It’s an easy and…

Read More

In FirewallD, the `–source` option allows you to specify a network or an IP address as the source for applying the rules. It is used to specify the network or IP address that is allowed to access the port or service that is being opened. The `–add-source` option is used to specify multiple networks or IP addresses as the source for the rules being applied. It is used in conjunction with the `–permanent` option to add multiple sources to a rule already configured in the firewall. Open Port for Single IP/Network For example, the following command will open port `80`…

Read More

In a high-traffic website, it’s essential to ensure that the web server can handle a large number of requests without causing server overload or poor performance. One way to achieve this is by using a reverse proxy server in front of the web server. A reverse proxy server, such as Nginx, can handle requests from clients and forward them to the web server, offloading some of the work and improving performance. In this article, we will discuss how to configure Nginx as a reverse proxy in front of Apache to optimize high-traffic websites. Step 1: Installing Nginx The first step…

Read More

Ubuntu is a popular open-source operating system based on the Linux kernel. It is widely used on personal computers, servers, and in cloud computing environments. One of the key tasks in managing a Ubuntu system is managing users and groups. In this article, we will explain how to add and delete users in Ubuntu 22.04. Before we begin, it is important to note that in Ubuntu, only users with administrative privileges (also known as “root” users) can add and delete other users. If you do not have administrative privileges, you will need to ask an administrator to perform these tasks…

Read More

To detect and handle errors in a bash script, you can use the `set -e` and `trap` commands, as well as the `if` and `case` statements and the `||` and `&&` operators. You can use the set -e command at the beginning of your script to enable this behavior, or you can use it before individual commands to enable it only for those commands. It’s important to note that the `set -e` command only affects the exit status of individual commands. It does not catch errors caused by syntax errors or other issues in the script itself. To catch these…

Read More

In Linux, PS1 is an environment variable that specifies the format of the command prompt displayed in the terminal. It stands for “Prompt String 1” and it is used to customize the appearance of the prompt. By default, the bash prompt includes the current username, hostname, and current working directory, followed by the `$` symbol for a regular user or the `#` symbol for the root user. The prompt is displayed on the command line, and it indicates that the terminal is ready for input. You can customize the bash prompt by modifying the value of the PS1 variable. For…

Read More