STATFS(1)
β¨ STATFS β¨
okay bestie, so this is statfs(1), from the STATFS(1) manual β and it's giving "tiny tool, huge brain" energy fr fr. π
π NAME π
statfs β dump the statfs(2) information for PATH to console in JSON format.
like. it dumps the statfs(2) info. to your console. in JSON. no cap. π«Ά
π SYNOPSIS π
statfs PATH
one command, one path, that's the whole vibe. β
πΈ DESCRIPTION πΈ
so the statfs(2) system call returns info about a mounted filesystem, and it hands it back inside a statfs_t structure. this tool dumps that info in JSON format. it's developed as part of gocryptfs and written in Go. π¦
lowkey important: the statfs_t structure is architecture-dependent. on amd64 it looks like this:
type Statfs_t struct {
Type int64
Bsize int64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
Fsid struct {
Val [2]int32
}
Namelen int64
Frsize int64
Flags int64
Spare [4]int64
}
go read the statfs(2) man page for what all these fields actually mean, bestie. and heads up β the field names here are acc. to the Go golang.org/x/sys/unix naming convention, and they're slightly different than in C. iykyk π
π₯ EXAMPLES π₯
get the statfs(2) information for /tmp:
$ statfs /tmp
{
"Type": 16914836,
"Bsize": 4096,
"Blocks": 3067428,
"Bfree": 3067411,
"Bavail": 3067411,
"Files": 3067428,
"Ffree": 3067381,
"Fsid": {
"Val": [
0,
0
]
},
"Namelen": 255,
"Frsize": 4096,
"Flags": 38,
"Spare": [
0,
0,
0,
0
]
}
look at that JSON. it ate and left absolutely no crumbs. π
π§ SEE ALSO π§
π AUTHORS π
github.com/rfjakob. periodt. π
Sep 2019 β STATFS(1) π ok that's the whole page bestie, go forth and dump those filesystem stats, you absolute main character πβ¨
π¦ where this page comes from
- debian trixie: gocryptfs 2.5.1-2+b1 Β· MIT
- ubuntu questing: gocryptfs 2.5.1-2
- ubuntu resolute: gocryptfs 2.6.1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms