- Write a bash script: Create a file with
#!/bin/bashat the top and script contents. - Execute a bash script:
bash [script_file] - Schedule a cron job:
crontab -eand add line[minute] [hour] [day_of_month] [month] [day_of_week] [command]
- Install packages (Debian/Ubuntu):
apt-get install [package] - Install packages (RedHat/CentOS):
yum install [package]ordnf install [package] - Start/stop a service:
systemctl start [service]orsystemctl stop [service] - Enable/disable a service at boot:
systemctl enable [service]orsystemctl disable [service]
- Change file access control lists:
setfacl -m u:[user]:[permissions] [file] - Firewall management (iptables):
iptables [options] - Scan for vulnerabilities (with nmap):
nmap -sV -T4 -O -F --version-light [target]
- Display kernel messages:
dmesg - Modify kernel parameters at runtime:
sysctl -w [parameter]=[value] - Monitor system performance:
vmstat,iostat - Check available entropy:
cat /proc/sys/kernel/random/entropy_avail
- Trace route to host:
traceroute [host] - Monitor network traffic:
tcpdump [options] - Analyze network performance:
iperf3 -s(server) andiperf3 -c [server_ip](client)
Note: Replace
[script_file],[package],[service],[user],[permissions],[file],[options],[target],[parameter],[value],[host], and[server_ip]with your specific details.