Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the command:

mv -v -f sourceDir destDir

How can I output the verbose console out to a file?

share|improve this question
Please make clear if the use case is 'shell scripting' or 'interactive shell usage'. For shell scripting the answer gt6989b applies. For interactive shell usage my answer applies. – user86064 Oct 31 '12 at 15:47
I used it for interactive mode, i wanted to move a large set of files from one disk that was falling to another which is new, and search after for failed copy attemps in order to know which files where not copied. in windows i know "xcopy source dest >>C:\files.txt " could do the job but windows could not read the file system correctly (NTFS !) and Linux Mint did ! Thanks for your answers will try them soon – firephil Nov 1 '12 at 17:13
up vote 5 down vote accepted

Try mv -v -f sourceDir destDir > out.file 2> err.file

share|improve this answer
Just tried this. It works. – VenkatH Oct 31 '12 at 15:40


 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
share|improve this answer
And how would he revert that? – VenkatH Oct 31 '12 at 15:37
Should be clear now :-) – user86064 Oct 31 '12 at 15:42
That's nice for logging the output of many commands. Upvoted! =) – VenkatH Oct 31 '12 at 15:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .