The output of tree on your machine uses special UTF-8 characters ├, ─, └ to draw the lines. On the one hand, these characters are not available in the standard LaTeX fonts. On the other hand, listings itself is not capable to typeset multibyte characters.
To include the output "as is" in you LaTeX document, a simple solution would be to use listings literate option to transparently transform these characters into something that listings can typeset:
\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage{listings}
\lstdefinestyle{ascii-tree}{
literate={├}{|}1 {─}{--}1 {└}{+}1
}
\begin{document}
\begin{frame}[fragile]
\begin{lstlisting}[style=ascii-tree]
5053
├── 20141018105053_100_samples.bin
├── 20141018105053_101_samples.bin
├── 20141018105053_102_samples.bin
├── 20141018105053_105_samples.bin
└── out
├── 20141018105053_100_samples.bin.pps
├── 20141018105053_101_samples.bin.pps
├── 20141018105053_102_samples.bin.pps
├── 20141018105053_105_samples.bin.pps
└── TOA_train.npy
\end{lstlisting}
\end{frame}
\end{document}

This basically mimics the tree output on a terminal that does not feature UTF-8. However, you could substitute with whatever you want (even macros), so the output could be improved even further. In the following, I replace them by some (plain) line drawing commands:
\lstdefinestyle{tree}{
literate=
{├}{{\smash{\raisebox{-1ex}{\rule{1pt}{\baselineskip}}}\raisebox{0.5ex}{\rule{1ex}{1pt}}}}1
{─}{{\raisebox{0.5ex}{\rule{1.5ex}{1pt}}}}1
{└}{{\smash{\raisebox{0.5ex}{\rule{1pt}{\dimexpr\baselineskip-1.5ex}}}\raisebox{0.5ex}{\rule{1ex}{1pt}}}}1
}
\begin{document}
\begin{frame}[fragile]
\begin{lstlisting}[style=tree]
5053
├── 20141018105053_100_samples.bin
├── 20141018105053_101_samples.bin
├── 20141018105053_102_samples.bin
├── 20141018105053_105_samples.bin
└── out
├── 20141018105053_100_samples.bin.pps
├── 20141018105053_101_samples.bin.pps
├── 20141018105053_102_samples.bin.pps
├── 20141018105053_105_samples.bin.pps
└── TOA_train.npy
\end{lstlisting}
\end{frame}
Which results in:
treeoutput directly into averbatimenvironment. – Daniel May 05 '17 at 20:40verbatimenvironment I have about the same output as OP in its original question. I might end up posting a new question for this unfortunately. – Antoine May 05 '17 at 20:43\setmonofont{Courier New}, and I can use xelatex to print the tree structure without the\lstdefinestylehacks, see some reference answers here: Print “Box drawing characters” from shell in lstlisting – ollydbg23 Jan 29 '18 at 04:36Package utf8x Error: MalformedUTF-8sequencewhen trying to include atreefile with\lstinputlisting– kebs Oct 14 '20 at 13:52