1
I've found this command to show a tree of the directories under the current one:
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
Which produces:
.
|-docs
|-lib
|-node_modules
|---connect-file-cache
|-----docs
|-----lib
|-----node_modules
|-------mime
|-------underscore
|-----src
|-----test
|-----test_fixtures
|---mime
|---snockets
That's good, but the files aren't there. My bash scripting skills are weak, so I have no idea how to get the files to show in that output.
Since I'm on Windows, I don't think I can get the tree
command into mingw32.
Does that work for you? (Second answer with the shell script) Mac OS X equivalent of the Ubuntu “tree” command
– slhck – 2013-01-10T18:52:58.3833What is wrong with the tree command in the cmd propmpt on your windows box? – EBGreen – 2013-01-10T18:54:28.117
@EBGreen If the OP wants the files to show, he should use (Command Prompt)
tree /f
– BenjiWiebe – 2013-01-10T18:56:19.923@BenjiWiebe that is why I asked what is wrong with the windows tree command. – EBGreen – 2013-01-10T18:57:48.733
@EBGreen I meant that if the OP did not like
tree
, he should usetree /f
to display the files, not just the directories. – BenjiWiebe – 2013-01-10T18:59:05.710"I don't think I can get the tree command into mingw32" Yes you can, just put
alias tree=tree.com
in your ~/.bashrc – BenjiWiebe – 2013-01-10T19:01:51.233@BenjiWiebe that is effectively the same as what I have already -- no files. – jcollum – 2013-01-10T22:39:18.750
@jcollum OK, try this in your .bashrc:
alias tree='tree.com /f'
– BenjiWiebe – 2013-01-10T22:41:28.110@EBGreen from OP: "That's good, but the files aren't there" -- which also applies to the tree command from cmd. I can add a /f to the command, but then bash thinks I'm trying to tree the /f drive. – jcollum – 2013-01-10T22:44:22.397
@BenjiWiebe nope, bash thinks the /f is a drive letter. – jcollum – 2013-01-10T22:47:54.260
@jcollum Interesting. I never noticed that. – BenjiWiebe – 2013-01-11T00:22:00.323