diff --git a/.bash_aliases b/.bash_aliases index 9633fd1..6a325bd 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -20,6 +20,22 @@ l () { return fi + # Current directory is the user home directory + if [ "$(pwd)" == "$HOME" ]; then + # Ignore these files when running the "l" command from the home directory + local BLACKLIST=("Makefile") + + local pattern + local pattern_ignore + + for pattern in "${BLACKLIST[@]}"; do + pattern_ignore+="-I \"$pattern\" " + done + + eval ls -lh $pattern_ignore + return 0 + fi + ls -lh $1 || l $(dirname "$1") }