#!/bin/sh -e

command -v gls >/dev/null 2>&1 && ls() { gls "$@"; }
command -v gsed >/dev/null 2>&1 && sed() { gsed "$@"; }

# shellcheck disable=SC2012
ls -ort --block-size="'1" --time-style='+ %Y-%m-%d %H:%M ' ~/Downloads \
  | sed -e 's/--x/1/g;s/-w-/2/g;s/-wx/3/g;s/r--/4/g;s/r-x/5/g;s/rw-/6/g;s/rwx/7/g;s/---/0/g;s/rwt/7/g' \
  | sed -e 's/^\(....\) [[:digit:]] /\1 /' \
  | tail -5
