How can I log the output of the mv command in Linux?
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle4
--
Chapters
00:00 How Can I Log The Output Of The Mv Command In Linux?
00:12 Accepted Answer Score 19
00:27 Answer 2 Score 9
00:50 Thank you
--
Full question
https://superuser.com/questions/497021/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #bash #mv
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle4
--
Chapters
00:00 How Can I Log The Output Of The Mv Command In Linux?
00:12 Accepted Answer Score 19
00:27 Answer 2 Score 9
00:50 Thank you
--
Full question
https://superuser.com/questions/497021/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #bash #mv
#avk47
ACCEPTED ANSWER
Score 19
Try mv -v -f sourceDir destDir > out.file 2> err.file
ANSWER 2
Score 9
Invoke:
exec > >(tee /tmp/logfile)
All the output (to stdout) of your next commands will be duplicated to the logfile.
This will continue till you leave the shell.
If you want this only for some commands create a subshell with:
bash | tee /tmp/logfile