2018-02-23 15:42:05 +00:00
|
|
|
# Returns the pid of process in charge of the given port
|
2018-01-23 11:19:27 +00:00
|
|
|
pid_for() {
|
|
|
|
echo $(ss -lptn "sport = :$1")
|
|
|
|
echo "---------\n"
|
|
|
|
echo $(netstat -nlp | grep ":$1")
|
|
|
|
echo "---------\n"
|
|
|
|
echo $(lsof -n -i ":$1" | grep LISTEN)
|
|
|
|
|
|
|
|
}
|
2018-02-22 12:15:26 +00:00
|
|
|
|
2018-02-23 15:42:05 +00:00
|
|
|
# Prints out the difference between file1 and file2
|
2018-02-22 12:15:26 +00:00
|
|
|
intersect_files() {
|
2018-02-23 11:06:54 +00:00
|
|
|
comm -23 <(sort $1) <(sort $2)
|
2018-02-22 12:15:26 +00:00
|
|
|
}
|