title: How can i get the tree style directory in linux centos to text file
body: <p>I have the directories and then subdirectories inside it.</p>
  
  <p>How can i export the <code>directory tree</code> with <code>custom depth level</code> and then export that to a text file</p>
  
  <p>basically i am looking for shell function</p>
  
  <p><code>printTree(level)</code></p>
  
  <p>so i get one text file like this</p>
  
  <pre><code>Dir1
  -------file1
  -------file2
  -------dir1
  -------dir2
  
  Dir12
  ----------file1
  </code></pre>
  
  <p>How can i do that</p>