remove rubbish from command output