From b01adfcbbbf3e6a618c4aad69ae9fca7901590e4 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 25 Dec 2025 12:05:37 +0100 Subject: [PATCH] feat(bash): run ls for symlink and binary files with l --- .bash_aliases | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index 0463208..9b7e9a4 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -17,6 +17,19 @@ l () { local target="${1:-$(pwd)}" if [ -f $target ] ; then + # Target is not a text file + if [ -L $target ] || grep -q -P "[^\x00-\x7F]" $target; then + ls -lah $target + + # Target is not a symlink, so it must be binary + if [ ! -L $target ]; then + echo "" + echo -e "\033[96mBinary file. Run 'll $target' to preview anyways.\e[0m" + fi + + return + fi + less $target return fi