The>redirection operator goes between the command and the filename.

If the file already exists, it’ll be overwritten.

If it doesn’t already exist, it will be created.

ipconfig all command redirected to TXT file

Although a file will be created if it doesn’t already exist, folders will not.

Make folders without leaving Command Prompt with themkdircommand.

The entire file path in wrapped in quotes because a space involved.

ping command redirected to text file

Theyahootracert.txtfile (shown above) will be created on theC:drive several seconds after executing thesample.batfile.

To save the results from a Terminal window, right-nudge the tab you’re working in and selectExport Text.

you could then choose where to save the TXT file.

ipconfig all results in LOG file

tracert BAT command with redirection operator

tracert yahoo.com command results