A command-line utility to get the size of a file or directory, written in Go
Run the following command to install or update an existing installation on UNIX-like operating systems:
curl -s https://filesize.i.masonfrancis.net/! | sudo bash
You're right to be wary of running random bash scripts on your system, so if you want to read through the install script before you run it, you can see it at https://filesize.i.masonfrancis.net/!?type=script. It's not very long.
Basically the script checks what OS and architecture you're using, downloads the appropriate binary, and installs it to a directory, most likely /usr/local/bin
.
If you get an error saying that the directory doesn't exist, you can create it with sudo mkdir -p [the directory path]
. If you do that, install successfully,
and try to run filesize
and it says it can't be found, you might need to add that directory to your PATH variable. Look up how to do that if you're not sure.
If you are using Windows, you'll need to download the executable for your operating system on the Releases page. If you want it to always be accessible via the command line or PowerShell, make sure to put it somewhere in your PATH variable (or add the directory it's in to your PATH variable). Look up how to do that if you're not sure.
filesize [flag] <file or directory>
-l
: List sizes of files within the first level of the directory-L
: List sizes of all subdirectories-h
: Show detailed usage information-v
: Show the version of the program
- The install script is generated by software found at https://github.com/jpillora/installer
- The binary is written and built using Go