feat(bash): run ls for symlink and binary files with l

This commit is contained in:
Victor Westerlund 2025-12-25 12:05:37 +01:00
parent 5dfd6cebaa
commit b01adfcbbb
Signed by: vlw
GPG key ID: D0AD730E1057DFC6

View file

@ -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