Find the answer to your Linux question:
Results 1 to 3 of 3
The command time shows the time taken by a command to complete. Is there a command that shows the change in disk usage caused by a command? I would like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    15

    [SOLVED] Show disk usage of a command?


    The command time shows the time taken by a command to complete. Is there a command that shows the change in disk usage caused by a command? I would like to know how large a package is when I install it from source.
    Any other solutions to this would also be welcome.

  2. #2
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    848
    You could use df on either side of the command:

    Code:
    kieren@George-Michael:~$ df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sdb6             59598820   4434544  52136832   8% /
    
    kieren@George-Michael:~$ echo "hello world" > /tmp/diskspaceusage
    
    kieren@George-Michael:~$ df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sdb6             59598820   4434548  52136828   8% /
    Linux User #453176

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    15
    Yeah, this thought did occur to me. I just wanted to know if there was a more streamlined way. I guess I could write a script for it...

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •