The command df [-h] gives the used/remaining space on all disks.
Can I somehow pipe this output to a different command and get the usage for my current disk (current disk = disk where my current working directory) is located?
The command df [-h] gives the used/remaining space on all disks.
Can I somehow pipe this output to a different command and get the usage for my current disk (current disk = disk where my current working directory) is located?
You can tell df to operate on any directory you like; thus
df -h .
will report the available space on the filesystem containing the current directory.
where my current working directory) is located?
running du -sh in your current working directory gives very simple and direct output of how much space is in and under the current working directory... as in 26M for example when I do it in my current working directory that has like couple subfolders and a handful of text files.
unless you must use df for some reason, based on what you are asking it sounds like you should be using du instead
also : https://www.redhat.com/sysadmin/du-vs-df
The (very complicated) answer can be best summarized like this: The df command provides a sweeping ballpark figure for how much space is being utilized on your filesystem as a whole. The du command is a much more accurate snapshot of a given directory or subdirectory.