2020-10-23 12:00:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Show type & contents of given files or PWD
|
2020-11-16 11:29:31 +00:00
|
|
|
for last; do true; done
|
|
|
|
last=${last:-.}
|
|
|
|
file "$last" | grep -v --color=never directory
|
2020-11-30 21:13:43 +00:00
|
|
|
stat -c 'Permissions: %A, Created: %.10w, Modified %.10y, Size: %s' "${@:-$last}"
|
2020-11-16 11:29:31 +00:00
|
|
|
case "$(file --dereference --mime "$last")" in
|
2020-11-30 21:13:43 +00:00
|
|
|
*inode/directory*) ls -l --color=auto --human-readable --group-directories-first --file-type --dereference-command-line --almost-all "$@";;
|
2020-11-16 11:29:31 +00:00
|
|
|
*binary) ;;
|
2020-11-26 19:32:26 +00:00
|
|
|
*) $(test -f "$last" -a ! -r "$last") bat --style header "$@";;
|
2020-11-16 11:29:31 +00:00
|
|
|
esac
|