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.
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
Post a Comment