This is my take on what you are asking for:
llt ()
{
[[ -n $1 ]] || return 1;
printf -v filetype '%s' $(type -ta $1);
prtecho "";
case $filetype in
"")
prtecho "llt: $1: not found" 1>&2;
return 1
;;
*alias*)
prt-underlineecho "Alias";
alias "$1" | awk '{sub(/^alias /, ""); print}';
prtecho ""
;;&
*function*)
prt-underlineecho "Shell Function";
declare -f "$1";
prtecho ""
;;&
*builtin*)
prt-underlineecho "Shell Builtin";
prtecho ""
;;&
*keyword*)
prt-underlineecho "Shell Reserved Word";
prtecho ""
;;&
*file*)
prt-underlineecho "File";
for fn in $(type -ap $1);
do
stat $fn | awk 'NR==1{sub(/^ File: /, ""); print}';
done
;;
esac
}
On my Mac, llt ls outputs:
Alias
ls='/usr/local/bin/eza'
File
/usr/local/gnubin/ls -> /usr/local/Cellar/coreutils/9.6/libexec/gnubin//ls
/bin/ls
The initial printf will create a one liner based on the type -ta $1 ie aliasfilefile
Each test of the case statement will perform the test and the ;;& tells the case statement to continue onto the next test (so the example will hit the alias test and the file test. You can use printf instead of my prt* functions
Forgot to mention if the command is an alias or function, I output the contents of that alias or function