How to display a tree of things in Bash?

How to create a tree of all things using bash? What is a team?

+5
source share
5 answers
tree /

or

find / 

Update: @OP, since you have so many problems with this, how about this alternative. On ubuntu 9.10, should you 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
+8
source

tree -R /

and then cry because it is huge.

In the corresponding note, to stop the command, press CTRL+C

+2
source
$ find . -print | sed -e 's;/*/;|;g;s;|; |;g'

~/.bash_profile

alias tree="find . -print | sed -e 's;/*/;|;g;s;|; |;g'"
+2

, , :)

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'

(: )

+1

, - ,

    tree / > tree.txt

Ctrl + F it.

0

All Articles