Most useful command I ever wrote.
$ cat ~/bin/lh
n=18
for a; do
shift
if [[ $a =~ [[:digit:]]+ ]]; then
n=$a
else
# directory list
dl+=("$a"); fi; done
if ((${#dl[*]})); then
for d in "${dl[@]}"; do
echo $d
ls -t "$d" | head -n$n; echo; done
else
# echo $PWD
ls -t | head -n$n; # echo;
fi
$ cat ~/bin/lh
n=18
for a; do
shift
if [[ $a =~ [[:digit:]]+ ]]; then
n=$a
else
# directory list
dl+=("$a"); fi; done
if ((${#dl[*]})); then
for d in "${dl[@]}"; do
echo $d
ls -t "$d" | head -n$n; echo; done
else
# echo $PWD
ls -t | head -n$n; # echo;
fi
Most useful command I ever wrote.
$ cat ~/bin/lh
n=18
for a; do
shift
if [[ $a =~ [[:digit:]]+ ]]; then
n=$a
else
# directory list
dl+=("$a"); fi; done
if ((${#dl[*]})); then
for d in "${dl[@]}"; do
echo $d
ls -t "$d" | head -n$n; echo; done
else
# echo $PWD
ls -t | head -n$n; # echo;
fi
0 التعليقات
0 نشر
60 ظهور