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
The command line arguments in /proc/PID/cmdline are separated by null bytes. You can use tr to replace them by new lines:
/proc/PID/cmdline
tr
tr '\0' '\n' < /proc/"$PID"/cmdline