使用 的命令df,我可以得到类似的信息:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 197844228 15578648 180242500 8% /
devtmpfs 4101368 0 4101368 0% /dev
tmpfs 820648 292 820356 1% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 1693720 4 1693716 1% /run/shm
Run Code Online (Sandbox Code Playgroud)
如果我只想保留记录的180242500号码/并将其存储在文件中怎么办(例如disk-space-available.txt)
如果我使用df >> disk-space-available.txt它将存储所有内容,而我只想要该文件中的原始数字。
例如,如果有这样的事情,那么它正在工作:
df -OUTPUT=raw-available-number
180242500
Run Code Online (Sandbox Code Playgroud)
我能做什么?
shell ×1