 <p>You may make use of stats maintained in /proc/[pid]/io . <p><strong>From /proc man page :</strong> <p>This file contains I/O statistics for the process, for example:</p> <pre><code> # cat /proc/3828/io rchar: 323934931 wchar: 323929600 syscr: 632687 syscw: 632675 read_bytes: 0 write_bytes: 323932160 cancelled_write_bytes: 0 write_bytes: bytes written Attempt to count the number of bytes which this process caused to be sent to the storage layer. </code></pre> <p><p> You may write script something like , </p> <pre><code>#!/bin/bash c=0 echo $1 rm /tmp/writtenBytes.txt psout=`ps aux | grep "$1" | grep -v $0 | grep -v grep ` while [[ "$psout" != "" ]] do pid=`echo $psout | awk '{print $2}'` cat /proc/$pid/io | grep write | grep -v cancelled &gt;&gt; /tmp/writtenBytes.txt psout=`ps aux | grep "$1" | grep -v $0 | grep -v grep` echo $psout sleep 1 done </code></pre> <p><p>Run this script as </p> <pre><code>bash -x getIO.sh "postgres: stats collector" </code></pre> <p><p>This script will create file /tmp/writtenBytes.txt, containing number of bytes written by processes named "postgres: stats collector"</p>