2

I wanted to copy all of the process information related to a specific program/software (Adobe in this case, other ones in the future) and so I tried holding Shift as mentioned here:

Is there a way to copy text in htop?

but this does not seem to work in Mac OSX terminal.

Does anyone know if this is possible and, if so, how to do this?

1

Instructions:

  1. Try using top instead of htop. The -l1 flag will provide a static output.
  2. Pipe to grep; or use the mouse; to isolate / extract a particular process. (Optional).
  3. Pipe the output directly into pbcopy; or use the mouse; or ⌘C; to copy.
  4. Use pbpaste; or the mouse; or ⌘V; to paste the captured output.

Code:

tjt263@osx:~$ top -l1 |grep -i adobe
86284- Adobe Flash Play 0.0  00:01.36 3     0   142+   24K+   0B   19M+   86284 1     sleeping *0[78+]       0.00000 0.00000    501 11281+     531+     2380+       867+        5758+       3320+       4770+       1993+    1        0.0   tjt263          N/A    N/A   N/A   N/A   N/A   N/A  
tjt263@osx:~$ top -l1 |grep -i adobe |pbcopy
tjt263@osx:~$ pbpaste 86284- Adobe Flash Play 0.0 00:01.36 3 0 142+ 24K+ 0B 19M+ 86284 1 sleeping *0[78+] 0.00000 0.00000 501 11281+ 531+ 2380+ 867+ 5758+ 3320+ 4770+ 1993+ 1 0.0 tjt263 N/A N/A N/A N/A N/A N/A


Screenshots:

In case this is confusing for you;
I have provided some cropped screenshots:

head tail

3

Try holding Alt/Option or fn+option while selecting.

1
  • This is perfect for more freedom selecting information and it is good for general freeform stuff. tjt263's solution is the more programmatically solid solution I was seeking. – Montag Mar 29 '16 at 19:36
0

Click with a mouse anywhere in the Terminal window.

Press Ctrl+a to select all text in the window.

Before the next refresh press Ctrl+c to copy all text.

Paste to a text editor with Ctrl+v and edit out unnecessary information.

1
  • Thanks! This does work but it is the longer/harder way to do it. tjt263's solution is the more programmatically solid solution I was looking for. – Montag Mar 29 '16 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.