Open sforsythe-wiley opened 6 months ago
What would be the drawback of including the directory usage and file count in the json file for directory? I think this would allow us to run jq filter and produce the above output
Example :
[
1,
2,
{
"progname": "gdu",
"progver": "v5.29.0",
"timestamp": 1724120998
},
[
{
"name": "/etc/audisp",
"mtime": 1701018116,
"asize" : 9313, <-----------
"dsize" : 20480, <-----------
"items" : 4 <-----------
},
[
{
"name": "plugins.d",
"mtime": 1701018116,
"asize": 4971, <-----------
"dsize": 12288, <-----------
"items": 3 <-----------
},
{
"name": "af_unix.conf",
"asize": 358,
"dsize": 4096,
"mtime": 1557149431
},
{
"name": "syslog.conf",
"asize": 517,
"dsize": 4096,
"mtime": 1557149431
}
],
{
"name": "audispd.conf",
"asize": 246,
"dsize": 4096,
"mtime": 1689530538
}
]
]
Yes, apologies, I didn't mean to imply the output should look the same as the du example, just the desired equivalent outcome. Putting into the json output and using jq to filter/sort was what I was envisioning as well, sorry if didn't make that clear.
Possible caveat that maybe need to indicate a directory vs a file. I guess you could filter on elements that contain an "items" count value.
I was hoping the output -o json would do this, but that feature appears more to save the state, to be fed back into gdu at a later time interactively.
I was hoping for the equiv of du --max-depth flag with possible improvement of output in json format,
eg: