Friday, February 14, 2014

find command line of a process

Define these alias in .bashrc file
# ps command
alias psef="ps -ef "           # all the process
alias pthread="ps -eLf "   # thread info
alias ptree="ps -ejH "       # process tree
alias pcmd="ps -fp "         # + PID#

Here is what you do: 
$ ptree   |   less         # find the PID interested, it only has partial command line.
$ pcmd   1234          # 1234 is the PID found above
$ pcmd   1234   >  file_abc      # 1234 is the PID found above , dump result into a file,
                                                 # which  guarantees a full display of the command.

No comments:

Post a Comment