Delete all SYSTEM V shared memory and semaphores on UNIX-like systems

前端 未结 11 2471
情话喂你
情话喂你 2020-12-23 14:01

How can I delete all not used semaphores and shared memory with a single command on a UNIX-like system, e.g., Ubuntu?

11条回答
  •  时光取名叫无心
    2020-12-23 14:52

    #!/bin/bash
    ipcs -m | grep `whoami` | awk '{ print $2 }' | xargs -n1 ipcrm -m
    ipcs -s | grep `whoami` | awk '{ print $2 }' | xargs -n1 ipcrm -s
    ipcs -q | grep `whoami` | awk '{ print $2 }' | xargs -n1 ipcrm -q
    

提交回复
热议问题