Skip to main content
added 200 characters in body
Source Link
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

If you have some file that has paths you want to check you can do something like following to create outputfile in each dir.

for i in $(cat filewithdirs); do tree "$i" -o "$i/outputfile"; done

If you want to get paths of all subdirectories in the parentdir you can use something like this

tree parentdir/ -L 1 -fid

This will print all first level subdirectories in parentdir with no indentation and with their path

  • -L option specifies how many levels deep do you want to go

  • -f options specified to print path prefix

  • -i specifies to not use indentation

  • -d specifies to only list directories

  • -o specifies to use outputfile instead of stdout

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

If you have some file that has paths you want to check you can do something like following to create outputfile in each dir.

for i in $(cat filewithdirs); do tree "$i" -o "$i/outputfile"; done

If you want to get paths of all subdirectories in the parentdir you can use something like this

tree parentdir/ -L 1 -fid

This will print all first level subdirectories in parentdir with no indentation and with their path

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

If you have some file that has paths you want to check you can do something like following to create outputfile in each dir.

for i in $(cat filewithdirs); do tree "$i" -o "$i/outputfile"; done

If you want to get paths of all subdirectories in the parentdir you can use something like this

tree parentdir/ -L 1 -fid

This will print all first level subdirectories in parentdir with no indentation and with their path

  • -L option specifies how many levels deep do you want to go

  • -f options specified to print path prefix

  • -i specifies to not use indentation

  • -d specifies to only list directories

  • -o specifies to use outputfile instead of stdout

added 200 characters in body
Source Link
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

If you have some file that has paths you want to check you can do something like following to create outputfile in each dir.

for i in $(cat filewithdirs); do tree "$i" -o "$i/outputfile"; done

If you want to get paths of all subdirectories in the parentdir you can use something like this

tree parentdir/ -L 1 -fid

This will print all first level subdirectories in parentdir with no indentation and with their path

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

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

If you have some file that has paths you want to check you can do something like following to create outputfile in each dir.

for i in $(cat filewithdirs); do tree "$i" -o "$i/outputfile"; done

If you want to get paths of all subdirectories in the parentdir you can use something like this

tree parentdir/ -L 1 -fid

This will print all first level subdirectories in parentdir with no indentation and with their path

added 4 characters in body
Source Link
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

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

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
Source Link
ralz
  • 2k
  • 15
  • 18
Loading