The reason is in kernel TASK_COMM_LEN (check man proc) constant fixed to 16 (name + \0). A guy called [Luben Tuikov][0] proposed to increase this back on 2006 ([last lines][1] of sys.c). Even if this is too difficult because of mysterous complicated reasons pgrep should search on the complete name, not the truncated version (/proc/PID/comm, /proc/PID/status | grep ^Name).
Maybe something like grep -hoa "\/[^/]*$" /proc/*/cmdline | grep -a pattern [or][2] ps aux | grep "[p]attern". With -f "the full command line is used" (/proc/PID/cmdline, readlink /proc/PID/exe). This is too broad. Something similar happen with the 4096 B limit of PAGE_SIZE. In that case the solution is easy, [just recompile the kernel][3] with a new value... :s [0](http://lkml.iu.edu/hypermail/linux/kernel/0606.2/3139.html) [1](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/sys.c#n2544) [2](https://unix.stackexchange.com/a/74186/209677) [3](https://stackoverflow.com/a/199199/4970442) -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to procps in Ubuntu. https://bugs.launchpad.net/bugs/295876 Title: top and ps truncate command after 15 chars Status in Procps: Confirmed Status in procps package in Ubuntu: Confirmed Bug description: Binary package hint: procps I guess this is an issue with 'top', and not really Ubuntu related, but... I noticed something hogging my CPU, and top revealed: 15219 root 30 10 109m 104m 4092 R 92 5.2 1:44.15 update- apt-xapi Of course, there is no such process called 'update-apt-xapi'. top truncates the process name to 15 chars (this was in fact 'update- apt-xapian-index' running). Nick To manage notifications about this bug go to: https://bugs.launchpad.net/procps/+bug/295876/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp