重定向
格式:
[command] [> | >>] [filename]
> 將 [command]的輸出儲存到[filename]中。
>> 將 [command]的輸出附加到[filename]中。
例子:
-
echo Hello World > myfile.txt將Hello World儲存到 myfile.txt 中 -
echo your name is %name% >> myfile.txt將“你的名字是 xxxx”附加到 myfile.txt 中 -
dir C:\ > directory.txt將 C:\的目錄儲存到 directory.txt