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

前端 未结 11 2493
情话喂你
情话喂你 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:43

    This is how I do it in FreeBSD:

    #!/usr/local/bin/bash
    for i in $(ipcs -a | grep "^s" | awk '{ print $2 }');
    do
            echo "ipcrm -s $i"
            ipcrm -s $i
    done
    

提交回复
热议问题