top command outputs a kind of live view of processes and their use of resources in a system.
I'd like to start a program on a server installation, which starts a variety of different processes, with non-predictable PIDs, and capture the changing output of
top, without having to rely on an ssh connection from a desktop environment. Preferably I'd like to be able to 'replay' this in the same CLI environment, as if it were a video, but could acceptably move the file elsewhere to view it like this.
Is there a way, using command line only, from a direct terminal on a server installation, that I can record this output for a defined time period? Either by entering a value for time, or by manually starting and stopping the recording process.