I would read up on using the pipe character '>' for redirecting stdout/console output - for example
$PS -e >Process-data.txt
or
$PS -e >> Process-data.txt
a single '>' creates a file and stores the output to it (from the stdout of the ps command)
a double '>' ie '>>' appends stdout data to the 'redirection target'
does that help ?