Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

up vote 3 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
add comment

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
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.