Skip to content

Instantly share code, notes, and snippets.

@void285
Created April 16, 2020 04:37
Show Gist options
  • Save void285/c87a54746566102c3077c3d7f55f6099 to your computer and use it in GitHub Desktop.
Save void285/c87a54746566102c3077c3d7f55f6099 to your computer and use it in GitHub Desktop.
file type statistic

file /bin/* | awk -F":" '{print $2}' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//' | sort | uniq -c | sort -k1nr | more

output example from coreelec:

CoreELEC:~ # file /bin/* | awk -F":" '{print $2}' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//' | sort | uniq -c | sort -k1nr | more
    138 ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
    135 symbolic link to busybox
     17 POSIX shell script, ASCII text executable
     11 Bourne-Again shell script, ASCII text executable
      4 ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
      4 symbolic link to pacat
      3 Python script, ASCII text executable
      2 ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /usr/lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
      1 ASCII text
      1 Bourne-Again shell script, UTF-8 Unicode text executable
      1 Perl script text executable
      1 Python script, ASCII text executable, with very long lines
      1 setuid ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, stripped
      1 symbolic link to ../sbin/openvpn
      1 symbolic link to /usr/bin/pastekodi
      1 symbolic link to /usr/sbin/xtables-legacy-multi
      1 symbolic link to avahi-browse
      1 symbolic link to cec-client-4.0.4
      1 symbolic link to cecc-client-4.0.4
      1 symbolic link to cputemp
      1 symbolic link to nano
      1 symbolic link to pastebinit
      1 symbolic link to python2
      1 symbolic link to python2.7
      1 symbolic link to python3.7
      1 symbolic link to systemd-mount
      1 symbolic link to xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment