Created
October 30, 2025 21:04
-
-
Save scott-joe/22e05125aa29c20c547cce656ecb62c0 to your computer and use it in GitHub Desktop.
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
| # `ls` for other things | |
| ################################################################################ | |
| ### Directories | |
| # Tree ignore patterns for noisy directories | |
| IGNORE_NOISY="node_modules|.git|__pycache__|.venv|venv|vendor" | |
| # Aliases using the variable | |
| alias lsd2="tree -dL 2 -I '$IGNORE_NOISY'" | |
| alias lsd3="tree -dL 3 -I '$IGNORE_NOISY'" | |
| alias lsd4="tree -dL 4 -I '$IGNORE_NOISY'" | |
| alias lsd="tree -dL 3" | |
| ################################################################################ | |
| ### Aliases | |
| lsa() { | |
| # Alias Lister with filtering | |
| # Usage: lsa [filter] | |
| # Example: lsa git | |
| local filter="$1" | |
| local cyan=$(tput setaf 6) | |
| local bold=$(tput bold) | |
| local reset=$(tput sgr0) | |
| if [[ -z "$filter" ]]; then | |
| alias | sort | sed "s/^alias //; s/'//g" | awk -F= "{name=\$1; sub(/^[^=]+=/, \"\"); printf \"${bold}%-15s${reset} ${cyan}→${reset} %s\\n\", name, \$0}" | |
| else | |
| alias | grep -i "$filter" | sort | sed "s/^alias //; s/'//g" | awk -F= "{name=\$1; sub(/^[^=]+=/, \"\"); printf \"${bold}%-15s${reset} ${cyan}→${reset} %s\\n\", name, \$0}" | |
| fi | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update
lsaandlsd