함수 disk used space()


개요

함수 disk_used_space()

Bash

df --block-size=1 --output=used / | sed 1d

Go

package main

import (
	"fmt"

	"golang.org/x/sys/unix"
)

func main() {
	var stat unix.Statfs_t
	unix.Statfs("/", &stat)
	fmt.Println((stat.Blocks - stat.Bavail) * uint64(stat.Bsize))
}

PHP

<?php
echo disk_total_space("/")-disk_free_space("/");

같이 보기