nixCraft Linux / UNIX Newsletter

Link to [RSS/Feed] nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format

BASH Prepend A Text / Lines To a File under Linux, macOS and Unix

Posted: 24 Aug 2020 07:25 AM PDT


{Updated} I am a new Unix system user with a bash as a default shell. I can append text to a file using >> operator but how do I prepend a text to a file? I want the opposite operation of >> operator. How can I prepend some data to a text file? How do we add text to the beginning of a file in Bash under Linux?

The post BASH Prepend A Text / Lines To a File under Linux, macOS and Unix appeared first on nixCraft.

How to save iptables firewall rules permanently on Linux

Posted: 24 Aug 2020 06:38 AM PDT

How to save iptables firewall rules permanently on Linux
I am using Debian / Ubuntu Linux server. How do I save iptables rules permanently on Linux using the CLI added using the iptables command? How can I store iptables IPv4 and IPv6 rules permanently on the Debian Linux cloud server?

The post How to save iptables firewall rules permanently on Linux appeared first on nixCraft.