Welcome, guest | Sign In | My Account | Store | Cart

Imitation of tree -d command.

Bash, 4 lines
1
2
3
4
#!/bin/bash

if [ -z "$1" ]; then loc=$(pwd); else loc=$1; fi
ls -R $loc | grep ':$' | sed -e 's/:$//;s/[^-][^\/]*\//--/g;s/^/ /;s/-/|/'

1 comment

manu 7 years ago  # | flag

WooT ! It's a great mini-tool :)

Created by greg zakharov on Fri, 11 Oct 2013 (MIT)
Bash recipes (41)
greg zakharov's recipes (59)

Required Modules

  • (none specified)

Other Information and Tasks