DEV Community 👩‍💻👨‍💻

Cover image for A tool to get a list of large files with description and colors
chgzm
chgzm

Posted on

A tool to get a list of large files with description and colors

fsrank: a quick overview

Since time immemorial, it is said that disk space mysteriously fills up quickly. We often have to remove unused files, but it is hard to identify which file is necessary or not, and we sometimes regret that we shouldn't have removed the one.

So, I created a tool to help you identify it.

GitHub logo chgzm / fsrank

Get file-size ranking in a directory

  • Show the file size ranking of the specified directory with the description of files
  • File paths are colored in accordance with LS_COLORS
  • Show modification times and access times, which helps you identify unused files

Screenshot
Alt Text

commandline

fsrank 
No   File Size  Access Time          Modification Time    File Description                                  Path                                                                                                                                                                
 1    448.889M  2020-10-18 23:09:07  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/server/libjvm.debuginfo
 2    134.649M  2020-03-28 15:35:44  2019-06-21 20:17:27  data                                              ./lib/modules
 3     55.218M  2019-07-19 18:55:32  2019-06-21 20:17:28  Zip archive data, at least v2.0 to extract        ./lib/src.zip
 4     21.617M  2019-07-01 00:06:00  2019-06-21 20:17:27  ELF 64-bit LSB shared object                      ./lib/server/libjvm.so
 5     19.779M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/java.base.jmod
 6     17.833M  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libfontmanager.debuginfo
 7     12.813M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/java.desktop.jmod
 8      9.113M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/jdk.localedata.jmod
 9      6.346M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/jdk.compiler.jmod
10      5.890M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/jdk.internal.vm.compiler.jmod
11      4.880M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/java.xml.jmod
12      4.281M  2019-06-21 20:17:27  2019-06-21 20:17:27  Java archive data (JAR)                           ./lib/ct.sym
13      3.077M  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libawt.debuginfo
14      2.214M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/jdk.hotspot.agent.jmod
15      2.108M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/jdk.scripting.nashorn.jmod
16      2.025M  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libawt_xawt.debuginfo
17      1.815M  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/liblcms.debuginfo
18      1.770M  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libjdwp.debuginfo
19      1.570M  2019-06-21 20:17:28  2019-06-21 20:17:28  Java archive data (JAR)                           ./demo/jfc/SwingSet2/SwingSet2.jar
20      1.559M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/jdk.javadoc.jmod
21      1.507M  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libmlib_image.debuginfo
22      1.416M  2019-06-21 20:17:28  2019-06-21 20:17:28  Zip archive data, at least v2.0 to extract        ./demo/jfc/SwingSet2/src.zip
23      1.408M  2019-06-21 20:17:27  2019-06-21 20:17:27  ELF 64-bit LSB shared object                      ./lib/libfontmanager.so
24      1.372M  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libsplashscreen.debuginfo
25      1.173M  2019-06-25 06:41:38  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libjava.debuginfo
26      1.093M  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/jdk.charsets.jmod
27    927.720K  2019-06-21 20:17:28  2019-06-21 20:17:28  Java archive data (JAR)                           ./demo/jfc/J2Ddemo/J2Ddemo.jar
28    907.078K  2019-06-21 20:17:28  2019-06-21 20:17:28  ELF 64-bit LSB shared object                      ./lib/libjavajpeg.debuginfo
29    869.290K  2019-06-21 20:17:27  2019-06-21 20:17:27  data                                              ./jmods/java.management.jmod
30    821.559K  2019-06-21 20:17:28  2019-06-21 20:17:28  Zip archive data, at least v1.0 to extract        ./demo/jfc/J2Ddemo/src.zip

Usage

Usage: fsize [-r] [-n num] [-h] [directory]
 -n, --num=N    Set number of files displayed
 -r, --reverse  Show files in ascending order
 -h, --help     Show help and exit
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Classic DEV Post

brain computer interface

Experimenting with brain-computer interfaces in JavaScript