小shell函数
whoport() {
port=$1
echo "------ who occupied port: $port ----------"
info=$(sudo lsof -i :$port)
if [[ "$info" = "" ]]; then
echo "No one occupied port: $port"
return
fi
echo "$info"
echo "------ where ----------"
sudo lsof -p $(sed -n 2p <<< "$info" | awk '{print $2}')
}
svndiff() {
REV=$1
OREV=$(($1 - 1))
svn diff -r $OREV:$REV
}
port=$1
echo "------ who occupied port: $port ----------"
info=$(sudo lsof -i :$port)
if [[ "$info" = "" ]]; then
echo "No one occupied port: $port"
return
fi
echo "$info"
echo "------ where ----------"
sudo lsof -p $(sed -n 2p <<< "$info" | awk '{print $2}')
}
svndiff() {
REV=$1
OREV=$(($1 - 1))
svn diff -r $OREV:$REV
}
hadoop大数据相关