Answer the question
In order to leave comments, you need to log in
Linux top command in batch mode - how to show filenames?
The top command has a strange feature - in interactive mode, by pressing 'c' you can switch from processes to the contents of the command line. In general, it’s convenient, but the oddity is that in batch mode (I don’t know how in Russian, that is, in non-iterative mode), the -c flag simply inverts this display mode relative to the previous launch. And I would like to get a listing of command lines every time in batch mode, well, that is, this will be used by the script in the future. Is that possible? maybe some environment variables?
Added: the top command is of interest, not ps, since the latter shows the CPU consumption for the entire lifetime of the process, and not the current one.
Answer the question
In order to leave comments, you need to log in
Have you even tried reading man ps?
take the -o option and throw in the columns you need, for exampleps -o pid,%cpu,cputime,command
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question