linux
general
echo -n - do not output a trailing newline
_COMMAND_1_; _COMMAND_2_ - sequential/multiple commands
= in less - show current position in the document
-N then CR in less - show line numbers
- globbing - pattern matching, not regex;
* - any character any number of times; ? - one character; [abc] - a or b or c; [0-9] - digits
grep -F - normal search, no regex
networking
sudo ip link set _INTERFACE_ { down | up } - enable/disable interface
sudo ip a add _IP_/_PREFIX_ dev _INTERFACE_ - add an IP to interface
sudo ip a del _IP_/_PREFIX_ dev _INTERFACE_ - remove an IP address from interface
ip r get _IP_ - show route for an IP
sudo ip r add _IP_/_PREFIX_ via _GATEWAY_IP_ [ dev _INTERFACE_ ] - add a route
sudo ip r del _IP_/_PREFIX_ via _GATEWAY_IP_ [ dev _INTERFACE_ ] - delete a route
firewalld
sudo firewall-cmd --list-all - show active config
firewall-cmd --get-services - show services
firewall-cmd --info-service _SERVICE_ - show info about a service
/usr/lib/firewalld/ - directory with firewalld XML files
sudo firewall-cmd --add-service=_SERVICE_ - add a service to firewall, only valid until reboot, add --permananent to make it persistent through the reboot
sudo firewall-cmd --add-port=_PORT_/_PROTOCOL_ - add a protocol; protocol is in { tcp | udp | sctp | dccp }
sudo firewall-cmd --remove-service=_SERVICE_ - remove a service
sudo firewall-cmd --remove-port=_PORT_/_PROTOCOL_ - remove a port
sudo firewall-cmd --reload - reload rules to update the running config