Finding out folder sizes from the command-line in a convenient manner continues to be a challenge, so here is a nifty little tool from Dumblebots to do just that.
AgFileSystemScanner (abbreviated to
fss) is a command-line application for Windows (x86-64) and Linux (x86-64) to do that and more.
fss gives you a listing of the directories from which it is invoked along with a summary of the file and symlinks, similar to the
ll commands. You can additionally get the last modification times and permissions (POSIX-style only) of each file, symlink and sizes of directories/folders (calculated recursively as the sum of the sizes of everything inside them). Instead of printing all entries, a pattern can be given and one of three search types can be specified to only print those entries that match the pattern.
You can specify the folder on which to scan, either with its absolute or relative path.
To run on current folder –
To run on parent folder –
To run on any folder (including root) –
fss provides additional options as follows –
- To expand and scan recursively, specify
--recursive. The maximum depth can be provided as the next argument.
- To expand and show all files, specify
- To expand and show all symlinks, specify
- To expand and show all other types of files, specify
- To show the permissions of each entry, specify
- To show the time of last modification of each entry, specify
- To recursively calculate and show the sizes of all directories, specify
- To show the full path (from root) of each entry, specify
Certain files and folders that are normally not accessible by the user (normally managed by the OS) may not be accessible to
fss either, depending on the permissions of the directory and the privileges of the user invoking
fss. Errors encountered while attempting to navigate such directories are normally hidden and can be views by specifying either the -e or –show-err flags.
fss can also be used to search for files, symlinks and directories, either by strictly matching the entire name with a pattern, matching the name without extension to the pattern or checking if the name contains the pattern. For example –
To find all files, folders in the current path whose name contains
temp along with their sizes –
fss -d --contains temp
To find all files inside
/usr/home, including sub-directories whose name exactly matches
answer.txt along with their permissions and last modification times –
fss /usr/home -r -f -p -t -S answer.txt
To find all symlinks inside
/usr/bin, including two levels within sub-directories whose name (not including the extension) matches
fss /usr/bin -r 2 -l --search-noext test
fss is a command line tool, sometimes the output may be too large to view in the terminal. To solve this, the output can be redirected to a text file, which can be opened by any editor to analyze the output. For example –
To completely scan through the C: drive on Windows and output the result to a text file –
fss c:\ -r -f -l -s -d > result.txt
The file will be created on the current path (path on which program was run) unless otherwise specified.
To see a summary of the usage instructions and list of options, use the
We hope that you find it useful. You can mail any comments and suggestions to email@example.com