Wednesday, June 29, 2022

A nice alias to check the resources used be each user on a Linux server

 Sometimes on a shared Linux server or AWS EC2, we found out the resources are limited because some other persons are using the machine, and we want to rank order the users by resources used from high to low. This alias does exactly this.


```

alias wtf="ps hax -o rss,user | awk '{a[\$2]+=\$1;}END{for(i in a)print i\"  \"int(a[i]/1024+0.5);}' | sort -rnk2"

```

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...