get ports used by process in linux code example Example: ubuntu check process on port sudo lsof -i:22