summaryrefslogtreecommitdiff
path: root/lsn
blob: 426d71bc2a5436c89334ef1a350b6ef83c3e63a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# New and better ls
# TODO: fix simlinks, flags break them for some reason, maybe switch to eza
ls_new() {
    LC_ALL=C $(which ls) -lAFh --color=always "$1" | awk '{
        name = $9;
        for (i = 10; i <= NF; i++) name = name " " $i;
        print $1, $5, name
    }' | column -t -l 3 -s ' ' | tail -n +2
}

dir="$1"
[ -z "$dir" ] && dir="$(pwd)"
ls_new "$dir"