Mark Block and Area in Windows Terminal

In addition to the ability to mark a character, a word and lines, windows terminal also provides to mark a block.

A marking mode that can be particularly useful for tabular work. It is allowed to mark and edit information that is directly adjacent to each other, without including the entire lines in the marking and editing.

Mark block and area in Windows Terminal.

The Alt key is used for the block marking. Position the mouse pointer at the beginning or end of the block, press the Alt key together with the left mouse button and drag the marker to the other end of the block. The selected block is automatically copied to the clipboard.

About Windows Terminal (wt)

Windows Terminal is a multi-tabbed terminal emulator developed by Microsoft for Windows 10 and later. As a replacement for Windows Console. It can run any command-line app in a separate tab. It is preconfigured to run Command Prompt, PowerShell, WSL, SSH, and Azure Cloud Shell Connector. Windows Terminal comes with its own rendering back-end. Version 1.11 on Windows 11, command-line apps can run using this newer back-end instead of the old Windows Console.

Since Windows 11 22H2 and Windows Terminal 1.15, Windows Terminal replaces Windows Console as the default.

Terminal is a command-line front-end. It can run multiple command-line apps, including text-based shells in a multi-tabbed window. They has out-of-the-box support for Command Prompt, PowerShell, and Bash on Windows Subsystem for Linux (WSL). It can natively connect to Azure Cloud Shell.

Block IP address using Linux Firewall

DDoS and suspicious attacks from source IP addresses can exhaust services and system resources. This tutorial show the commands to block IP address on common Linux Kernel Firewalls

Fire up a terminal and log on to the server by using SSH and then complete the steps for firewalld in the first chapter. The second chapter shows the commands for UFW, and the third shows using iptables.

Block IP address using Linux firewall

firewalld is on RHEL 7 and later, CentOS 7, Fedora 18 and later.

To ensure that firewalld is running on your server, run the following command. If firewalld is not running, go to the iptables chapter.

$ sudo systemctl status firewalld

Run the following command to block the IP address using Linux Firewall and to add the rule to the permanent set:

$ sudo firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='xxx.xxx.xxx.xxx' reject"

Run the following command to reload the firewalld rules:

$ sudo firewall-cmd --reload

Run the following command to list and verify the new rule:

$ sudo firewall-cmd --list-all

Run the following command to remove a blocked IP address.

$ sudo firewall-cmd --remove-rich-rule="rule family='ipv4' source address='xxx.xxx.xxx.xxx' reject"

Run the following command to verify the firewalld is running.

$ firewall-cmd --state

Uncomplicated Firewall (UFW)

ufw is available on Debian 6 and later, Ubuntu 8.04 LTS and later.

To ensure that ufw is running on your server, run the following command. If ufw is not running, go to the iptables chapter.

$ sudo systemctl status ufw

Run the following command to block the IP address:

$ sudo ufw deny from xxx.xxx.xxx.xxx to any

Run the following command to list and verify the new rule:

$ sudo ufw status

Run the following command to remove a blocked IP address.

$ sudo ufw delete 7

Run the following command to show numbered list of firewall rules.

$ ufw status numbered

Block IP addresses using Linux iptables chains

iptables is commonly pre-installed on all Linux distributions.

Run the following command to block the IP address:

$ sudo iptables -I INPUT -s xxx.xxx.xxx.xxx -j DROP

Run the following command to save the settings. The settings persist after the server reboots.

$ sudo service iptables save

Run the following command to list and verify the new rule:

$ sudo iptables -vnL

Run the following command to delete a iptables chain.

$ sudo iptables -D INPUT 7

Run the following command to show numbered list of iptables chains.

$ sudo iptables -L --line-numbers

The next related post might also be helpful, see in Block suspicious IP with Linux firewall daemon.

Exit mobile version