# unset possible system-defined aliases.
unalias l ll lll llll la laa &> /dev/null
unset l ll lll llll la laa &> /dev/null

# list files in dir.
l()
{
  ls -lhvt --si --group-directories-first "$@"
}

# list all files in dir, incl. hidden files.
ll()
{
  ls -lAhvt --si --group-directories-first "$@"
}

# list files in tree structure.
# usage: lll [DEPTH] [FILES]
lll()
{
  local depth="${1}"
  local target="${@:2}"

  if [[ "${target}" = "" ]]; then
    target="."
  fi

  if [[ "${depth}" = "" ]]; then
    tree -a -- "${target}"
  else
    tree -a -L "${depth}" -- "${target}"
  fi
}

# list files recursively.
llll()
{
  ls -RlAhvt --si --group-directories-first "$@"
}

# list files alphabetically.
la()
{
  ls -lh --si --group-directories-first "$@"
}

# list all files alphabetically.
laa()
{
  ls -lAh --si --group-directories-first "$@"
}

# export.
export -f l ll lll llll la laa