Collect data from shell command and sorts the command