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

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

    ipcs -s | grep $USERNAME | perl -e 'while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
    

    or

    ipcs -s | grep $USERNAME | awk ' { print $2 } ' | xargs ipcrm sem
    

    Change $USERNAME to a real username.

提交回复
热议问题