Last active
December 4, 2017 18:03
-
-
Save webmaster128/aa859df4af851b15b45e183a3baf157b to your computer and use it in GitHub Desktop.
An interactive command line tool for Linux and Mac that can show directories and files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __inspect_impl() { | |
| if [ -d "$1" ]; then | |
| #echo -n "Recusive size: " | |
| #du -hs "$1" | awk '{print $1}' | |
| ls -l -h -A "$1" | |
| elif [ -f "$1" ]; then | |
| less "$1" | |
| else | |
| echo "Path '$1' is of unknown type" | |
| return 1 | |
| fi | |
| } | |
| inspect() { | |
| if [ "$#" -eq 0 ]; then | |
| inspect . | |
| fi | |
| for var in "$@" | |
| do | |
| if ! __inspect_impl "$var" ; then | |
| return $? | |
| fi | |
| done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment