command line - How to redirect dd progress in terminal to a log.txt file but still display it on the terminal during the process? - Ask Ubuntu


here script :-

sudo mate-terminal --geometry=50x10 -x sh -c "dd if=/dev/sda of=/dev/sdb status=progress 2>&1 | tee log.txt | md5sum > hash.txt | sha1sum > hash1.txt" 

i've seen people giving suggestion time; putting 2>&1. display progress in log.txt file , terminal display nothing. here's picture of progress on log.txt file.

logfile

if remove 2>&1 , go with

command | tee log.txt 

only terminal show progress , nothing display in log.txt file

i've tried:-

(command 2>&1) | log.txt  command 2> | log.txt 

and many more can't recall. can me?

redirect both stderr , stdout |& in bash:

sudo mate-terminal --geometry=50x10 -x bash -c "dd if=/dev/sda of=/dev/sdb status=progress |& tee log.txt" 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User