When not a meterpreter session,  split dir/ls output to match meterpreter entries output