How do I make a tree of all things with bash? What is the command?
+3
A:
tree /
or
find /
Update: @OP, since you have so much trouble with it, how about this alternative. On ubuntu 9.10, you should have bash 4.0 ? so try this
#!/bin/bash
shopt -s globstar
for rdir in /*/
do
for file in $rdir/**
do
echo "$file"
done
done
ghostdog74
2010-03-15 00:19:27
none of them work...i'm using virtual machine, could be that?tree / says that is not installed
pedro
2010-03-15 00:22:31
If tree isn't installed on your Ubuntu machine use: `sudo aptitude install tree`
Ben S
2010-03-15 00:23:30
you don't even have find??
ghostdog74
2010-03-15 00:26:18
the same...0 packages installed :S
pedro
2010-03-15 00:26:42
findutils is a dependency of libc6, which many, many core packages (including apt!) depend on. And Ben gave correct instructions for installing `tree`. So I'm not sure what's going on.
Matthew Flaschen
2010-03-15 00:39:43
says "couldn't find package "tree""...
pedro
2010-03-15 00:41:21
The tree package (http://packages.ubuntu.com/karmic/tree) is part of the universe packages, which might not be enabled. I would ask this question on the Ubuntu forums as it's not strictly programming related and they would likely already have resources to point you towards to help you out.
Ben S
2010-03-15 00:43:58
+1
A:
tree -R /
and then cry because it's enormous.
On a related note, to stop the command, press CTRL+C
Ben S
2010-03-15 00:21:07