I need to grep process by information containing in CMD column, but this column strings is cut(limited) and needed info is lost. Please suggest how can I enlarge string size allowed for CMD column.
2 Answers
You can try grepping in the /proc
directory:
$ grep -a foo /proc/[0-9]*/cmdline
The -a
switch says to treat binary files as text files, since cmdline
files are recognized as binary. /proc/[0-9]*
says to only look at the directories mapped to PIDs. When you find a match, you can use that output to get the PID from the directory structure.
Add the -w
option twice to remove the width limit.
-
Aaaand that makes my answer look stupid. I missed that option; good one.– user235731Jul 12, 2013 at 12:35
-
-
@user590444: Exactly what OS and which
ps
version are you using? Jul 12, 2013 at 13:51 -