I'm new to bash and Linux and have a question. My problem is that I want to print a process name by its pid. I've googled and found few ways to do it:ps -p <PID> -o cmd ps -p <PID> -o comm etc. I'm using Xubutnu 14.04 and first command (on an arbitrary pid) showed me:CMDx-session-managerand the second one:COMMANDx-session-managas you can see second name is not full. Plus, they both have a column name. I found that adding = at the end of the command would make column name disappear. I've read man ps but could not understand the real difference between comm and cmd (because on explanation on both of them was alias). What are the differences between the cmd and comm flags to ps -o?
difference between args in ps command
ps;xubuntu