Skip to main content
2 of 4
added 4 characters in body
ralz
  • 2k
  • 15
  • 18

You don't need to cd to directory to use tree command on it, and you can specify multiple directories to use tree on them at the same time.

tree /dir1 /dir2 /dir3 -o /some/other/path/outputfile -n

also if you want to use stdout redirection like > or >> you can specify a path there also

tree /dir1 /dir2 /dir3 -n > /some/other/path/outputfile
ralz
  • 2k
  • 15
  • 18