Forrest logo
back to the ufw tool

ufw:tldr:e06db

ufw: Delete a particular rule. The rule number can be retrieved from the `ufw status numbered` command.
$ ufw delete ${rule_number}
try on your machine

This command is used to delete a specific rule from the Uncomplicated Firewall (UFW) configuration.

Here's a breakdown of the command:

  • ufw: It is the command-line tool to manage the Uncomplicated Firewall (UFW) in Ubuntu and other Debian-based operating systems.
  • delete: This is the subcommand of ufw used to remove a rule from the firewall configuration.
  • ${rule_number}: This is a placeholder for the actual number representing the rule you want to delete. You need to replace ${rule_number} with the real rule number you want to remove.

To use this command, you need to know the rule number you want to delete. To find the rule number associated with a specific rule, you can run ufw status numbered command, which lists all the rules along with their rule numbers. Once you have the rule number, you can replace ${rule_number} in the command with the actual number and execute it to delete the desired rule from the UFW configuration.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ufw tool