GNU ps

GNU ps is an alternative solution to the messy ps in procps (currently 3.2.8). This ps under Linux makes great effort to be compatible with many BSDs and Unixes, while having GNU long options (starting with --). The purpose of gps to eliminate all the messes the backward compatibility with old BSDs and Unixes (who cares?)

http://code.google.com/p/gnups/

深入研究发现,BSD风格的选项功能更灵活,而且输出更友好。例如Unix风格下,默认的COMMAND列只包含命令名的前15个字符(从/proc/<pid>/stat)获取,而BSD风格始终是完整的命令名。所以,我打算坚持用BSD风格选项,在.bashrc里面加入了:

export PS_PERSONALITY=bsd

这样就保证ps始终输出BSD风格选项下的列,总是可以得到统一的输出。但是BSD选项和其它选项的功能不能完全一致,所以会缺少某些功能。看来还得改进!