Utskrift av port, pid og daemon navn v.h.a netstat
netstat -nap| egrep “(0.0.0.0).*(0.0.0.0).*LISTEN” | gawk ‘{print $4 “:” $7}’ | egrep -o “:(.*)” | cut -c 2-|sed ‘s/\//\:/’
A chronological documentation test project, nothing serious, really!
netstat -nap| egrep “(0.0.0.0).*(0.0.0.0).*LISTEN” | gawk ‘{print $4 “:” $7}’ | egrep -o “:(.*)” | cut -c 2-|sed ‘s/\//\:/’
#!/bin/bash # Shell script to restart MySQL server if it is killed or not working # due to ANY cause. # When script detects mysql is not running (it basically sends ping request # to MySQL) it try to start using /etc/init.d/mysql script; and it sends an # email to user indicating the status. # […]
Oneliner to determine recursive diskusage in catalogs ls -lR|du -sh *
#!/bin/bash # # Shell script utility to read a file line line version 2 # This is simpler version of readline script # This script also demonstrate how to process data file # line by line and then separate line in fields, so that # you can process it according to your need. # # […]