Useful day-to-day linux commands to know
Make directory recursive (that is create all subdirectories if they are missing)
$> mkdir -p /opt/mediagateway/var/lib/gateway/settings/
Find filename that matches string
$> sudo find / -name admin_*
In this case it will search all files that begins with admin_
Search inside files for content matching string
$> sudo grep -R "my-regular-expression-search" /
on some distributions the -R is lowercase :
$> sudo grep -r "my-regular-expression-search" /
Find network ports opened
netstat -a
netstat -a | grep TIME_WAIT | wc -l
netstat -a | grep TIME_WAIT | grep ":8080 " | wc -l
Killing processes piped
ps -ef | grep phantom | grep -v grep | awk '{print $2}' | xargs kill -9
or simpler if you have killall
sudo killall -9 phantomjs
Recent Comments