Created
February 17, 2010 15:41
-
-
Save zed9h/306726 to your computer and use it in GitHub Desktop.
track file upload progress on firefox or any other single-threaded linux browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export FILE=$1 | |
export BROWSER=firefox | |
export PID=$(ps aux | sed -n "/grep/d;s/^$USER *\([0-9]\+\) .*\<$BROWSER.*/\1/p") | |
export FD=$(ls -l /proc/$PID/fd/ | sed -n "s/.* \([0-9]\+\) -> [^ ]*$FILE$/\1/p") # FIXME convert file to pattern | |
watch "cat /proc/$PID/fdinfo/$FD | sed -n 's/pos:\t//p' ; stat -L /proc/$PID/fd/$FD -c %s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment