Advertisement
Danila_lipatov

check_ports_terminal

Dec 23rd, 2024
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. """
  2. Commands to check any active processes on host-port
  3.  
  4. example: lsof -i :8000
  5. where 8000 is current port
  6.  
  7. Output example:
  8. Python 10959 name 3u IPv4 0xe72a6101950ead6f 0t0 TCP localhost:irdmi (LISTEN)
  9. Python 12586 name 3u IPv4 0xe72a6101950ead6f 0t0 TCP localhost:irdmi (LISTEN)
  10.  
  11. There are 2 process with PID 10959 / 12586
  12.  
  13. Commands for kill this processes:
  14.  
  15. example: kill -9 10959
  16.  
  17. To check what each process is for use this:
  18. ps -p 10959 -o command
  19. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement