1
0
Fork 0
mirror of https://github.com/jarun/nnn.git synced 2025-02-18 23:34:37 +00:00
nnn/plugins/mimelist

15 lines
347 B
Text
Raw Normal View History

#!/usr/bin/env sh
2020-11-22 20:09:14 +05:30
# Description: Find and list files by mime type in smart context
#
# Shell: POSIX compliant
2020-05-04 06:17:38 +05:30
# Author: Arun Prakash Jana
. "$(dirname "$0")"/.nnn-plugin-helper
2020-11-12 08:17:14 +05:30
printf "mime (e.g., video/audio/image): "
read -r mime
printf "%s" "+l" > "$NNN_PIPE"
2020-11-22 20:09:14 +05:30
find . | file -if- | grep "$mime" | awk -F: '{printf "%s\0", $1}' > "$NNN_PIPE"