How to parse /proc/pid/cmdline

前端 未结 7 1921
盖世英雄少女心
盖世英雄少女心 2021-02-01 18:51

I\'m trying to split the cmdline of a process on Linux but it seems I cannot rely on it to be separated by \'\\0\' characters. Do you know why sometimes the \'\\0\' character is

7条回答
  •  不知归路
    2021-02-01 19:44

    Have a look at my answer here. It covers what I found when trying to do this myself.

    Edit: Have a look at this thread on debian-user for a bash script that tries its best to do what you want (look for version 3 of the script in that thread).

提交回复
热议问题