| Gestione Servizi |
| Avviare un servizio | systemctl start nome | launchctl start nome | macOS usa launchd |
| Fermare un servizio | systemctl stop nome | launchctl stop nome | Ollama: launchctl stop io.ollama |
| Riavviare un servizio | systemctl restart nome | Stop + Start | macOS non ha restart diretto |
| Stato servizio | systemctl status nome | launchctl print system/nome | Esempio: launchctl print system/io.ollama |
| Abilitare all’avvio | systemctl enable nome | Automatico se .plist presente | macOS non ha “enable” |
| Disabilitare all’avvio | systemctl disable nome | launchctl unload /Library/LaunchDaemons/nome.plist | Oppure rimuovere il .plist |
| Processi e Sistema |
| Lista processi | ps aux | ps aux | Uguale |
| Kill processo | kill -9 PID | kill -9 PID | Uguale |
| Monitor risorse | htop | top | htop installabile via brew |
| File System |
| Spazio dischi | df -h | df -h | Uguale |
| Spazio directory | du -sh * | du -sh * | Uguale |
| Permessi | chmod 755 file | chmod 755 file | Uguale |
| Proprietario | chown user:group file | chown user:group file | Uguale |
| Rete |
| IP configurazione | ip a | ifconfig | macOS non ha “ip” |
| Routing | ip route | netstat -rn | Uguale |
| Ping | ping -c 4 host | ping -c 4 host | Uguale |
| Traceroute | traceroute host | traceroute host | Uguale |
| DNS lookup | dig dominio | dig dominio | Uguale |
| Flush DNS | N/A | sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder | macOS ha DNS aggressivo |
| ARP table | arp -n | arp -n | Uguale |
| Netcat | nc -lvp 4444 | nc -lvp 4444 | Perfetto per test porte |
| Test porta TCP | nc -zv host 22 | nc -zv host 22 | Uguale |
| TCPDump | tcpdump -i eth0 | tcpdump -i en0 | Interfacce diverse |
| Firewall |
| Regole firewall | iptables -L | N/A | macOS usa Application Firewall |
| NAT | iptables -t nat -L | N/A | macOS non espone NAT via CLI |