# rm-rf.es

Unix: Árbol gráfico de todos los subdirectorios

Me ha parecido interesante esta serie de comandos que logran sacar un árbol estructurado de todos los subdirectorios desde el punto en el que nos encontramos:

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

El resultado sería algo así:

  .
   |-bin
   |-etc
   |---gconf
   |-----schemas
   |-games
   |-include
   |---arpa
   |---asm
   |---asm-generic
   |---atk-1.0
   |-----atk
   |---bits
   |---c++
   |-----4.2
   |-------backward
   |-------bits
   |-------debug
   |-------ext
   |---------pb_ds
   |-----------detail
   |-------------basic_tree_policy
   |-------------binary_heap_
   |-------------binomial_heap_
   |-------------binomial_heap_base_
   |-------------bin_search_tree_
   |-------------cc_hash_table_map_
   |-------------eq_fn
   |-------------gp_hash_table_map_
   |-------------hash_fn
   |-------------left_child_next_sibling_heap_
   |-------------list_update_map_
   |-------------list_update_policy
   |-------------ov_tree_map_
   |-------------pairing_heap_
   |-------------pat_trie_
   |-------------rb_tree_map_
   |-------------rc_binomial_heap_
   |-------------resize_policy
   |-------------splay_tree_
   |-------------thin_heap_
   |-------------tree_policy
   |-------------trie_policy
   |-------------unordered_iterator
   |-------i486-linux-gnu
   |---------64
   |-----------bits
   |---------bits
--Más--

Vía | www.commandlinefu.com

Salir de la versión móvil