【问题标题】:How long is the limitation of the length of the file `/proc/{processId}/cmdline`?文件`/proc/{processId}/cmdline`的长度限制是多少?
【发布时间】:2023-03-03 21:47:01
【问题描述】:

我有一个java进程,它的classpath包含很多jar,所以启动命令很长。

假设进程id是110101,当我通过命令cat /proc/110101/cmdline查看命令时,我发现命令不完整,它只包含大约4000个字符。

还有其他方法可以显示原来的启动命令吗?

【问题讨论】:

    标签: linux command


    【解决方案1】:
     man proc
    
     /proc/[pid]/cmdline
                  This holds the complete command line for the process, unless
                  the process is a zombie.  In the latter case, there is nothing
                  in this file: that is, a read on this file will return 0
                  characters.  The command-line arguments appear in this file as
                  a set of strings separated by null bytes ('\0'), with a
                  further null byte after the last string.
    

    它可能不会通过 cat 文件为您提供所有参数。

    【讨论】:

      猜你喜欢
      • 2019-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-08
      • 1970-01-01
      • 2015-04-15
      • 2010-09-16
      相关资源
      最近更新 更多