Linux tip: `lsof -i :8080` shows which process is using port 8080. Essential when you get "port already in use" errors during development or when troubleshooting service conflicts. #Linux #SystemAdministration
@monospace `ss -lpn | grep :8080` is my goto personally. I find it much more robust and fast. ymmv.
#linux #sysadmin #networking

@mikebabcock @monospace as someone trying to learn `ss` command line syntax, couldn’t you just add `:8080` to the `ss` command line?

I thought one of `ss`’s claims to gain was I reheated filtering.

Maybe I’m wrong. I’m not at a terminal.

@drscriptt @monospace ss has a full query/filter language built-in but no as far as I know, you cannot just specify a port that easily. I always use grep.

That said ... this will do exactly what it looks like, and is a good example* of port specifications though:
# ss -o state established '( dport = :smtp or sport = :smtp )'

* Example stolen from https://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html

#networking #linux

ss command: Display Linux TCP / UDP Network/Socket Information - nixCraft

Use ss command on Linux to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state information than other tools.

nixCraft

@mikebabcock @monospace okay, this motivated me to get up off my duff, walk to a terminal, unlock, and test things:

`ss -lnp src :8080 or dst :8080`

So it seems like `grep :8080` might be fewer keystrokes.

But you can do all sorts of logic with built in gamer in `ss`. Like when you want to look for specific sets of ports talking to each other -or- other sets of ports talking with each other. Nested conditionals that start to get quite tricky with things like grep.

@drscriptt @monospace its very handy when looking for specific connections, or frequently in my case, connections not coming from specific subnets:

```ss not src $LOCALNET/24 dport :587```

But those more 'interesting' commands I've just saved to mini ~/bin/ scripts so I don't have to type them and frequently forget the syntax.

#oldmanbrain #sysadmin #networking

@mikebabcock @monospace is “LOCALNET” a textual place holder? Or is it some sort of keyword that `ss` substitutes?

I’m inclined to guess place holder as I’d assume that `ss` would have an array of directly attached networks with proper netmask, thus alleviating the need for the `/24`.

@drscriptt @monospace I'm using it as a visual variable. Replace with 10.11.12.0 or 192.168.0.0 ... apologies for confusion

@mikebabcock @monospace 👍🏻

thank you for clarifying and confirming what I suspected to be the case.