I want to calculate the temporary amount of disk space used by an application in GB on Linux(ubuntu 14.04) How can I do it?
closed as unclear what you're asking by user34720, Rui F Ribeiro, Kusalananda♦, Jeff Schaller♦, Archemar Jun 14 '17 at 19:15
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
I want to calculate the temporary amount of disk space used by an application in GB
(actually, defining precisely what is the temporary amount of disk space is not easy at all; once you did that you could get a better answer)
Maybe you want to measure the size of temporary files in some process running your application (that is, those files which have an open file descriptor, but whose name was
unlink-ed from their directory). Then read much more about proc(5). From inside your application, consider using
/proc/self/fd/ (you could opendir(3), readdir(3),
closedir it etc). From outside your application, if its process is 1234, consider using
If you're trying to grab how much space was consumed on installation, a combination of yum whatprovides and yum info should set you right.
yum whatprovides sed sed-4.2.2-5.el7.x86_64 : A GNU stream text editor Repo : rhel-7-server-rpms yum info sed-4.2.2-5.el7.x86_64 ##CHECK Size: Installed Packages Name : sed Arch : x86_64 Version : 4.2.2 Release : 5.el7 Size : 587 k Repo : installed From repo : anaconda Summary : A GNU stream text editor URL : http://sed.sourceforge.net/ License : GPLv3+ Description : The sed (Stream EDitor) editor is a stream or batch (non-interactive) : editor. Sed takes text as input, performs an operation or set of : operations on the text and outputs the modified text. The operations : that sed performs (substitutions, deletions, insertions, etc.) can be : specified in a script file or from the command line.