Forrest logo
back to the nft tool

nft:tldr:75ade

nft: Save current configuration.
$ sudo nft list ruleset > ${-etc-nftables-conf}
try on your machine

This command is used to list and display the current Nftables ruleset configuration and save it to a file named ${-etc-nftables-conf}.

Let's break down the command:

  • sudo: This is a command line utility that allows a user with administrative privileges to execute commands as a superuser or another user.

  • nft: This is the command-line tool used to interact with Nftables, a subsystem within the Linux kernel that manages packet filtering and network address translation.

  • list ruleset: This is an argument passed to the nft command, instructing it to display the current configured ruleset.

  • >: This is a redirection operator in the shell that redirects the output of a command to a file.

  • ${-etc-nftables-conf}: This is the file name where the output of the nft list ruleset command will be saved. The ${-etc-nftables-conf} is a variable representation used here, and it might not be the correct syntax. It should be something like /etc/nftables.conf or another valid filename.

So, when executing this command with appropriate values set for ${-etc-nftables-conf}, it will run nft list ruleset, retrieve the current Nftables ruleset, and save it to the specified file. The sudo command is used to ensure the user has the necessary privileges to execute nft with administrative access.

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 nft tool