Skip to Content

Why the output getting trimmed in Parallel shell?

Output getting truncated in Parallel shell

When commands such as top are run in a parallel shell, the output gets truncated as in the following screenshot:-

 

The ''+"  in the commands shows that the output has been trimmed.

That's because the parallel shell doesn't open a pseudo-terminal (PTY) on the remote host. It just executes the command over SSH and returns the output. So certain commands like top and those that use ncurses like terminal UI libraries cannot get the size of the window properly and truncates output to default. You can override the default by specifying a custom width in the case of top by passing the -w parameter like:

top -cb -w200 | head -10

For example::-

 

Related articles:-