China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 09:57
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Question about “redirection”, thanks View 795 Replies 4
Original Poster Posted 2010-05-01 19:25 ·  中国 北京 朝阳区 联通
新手上路
Credits 2
Posts 2
Joined 2010-03-11 13:46
16-year member
UID 161996
Gender Male
Status Offline
How do I redirect the result to a text file, but not have it echoed in the window? Thanks

For example: redirect the result of the dir command to 1.txt, but don't display it in the window
Floor 2 Posted 2010-05-01 19:27 ·  中国 广东 东莞 电信
初级用户
Credits 175
Posts 45
Joined 2007-08-04 16:16
19-year member
UID 94640
Gender Male
Status Offline
Floor 3 Posted 2010-05-01 19:33 ·  中国 北京 朝阳区 联通
新手上路
Credits 2
Posts 2
Joined 2010-03-11 13:46
16-year member
UID 161996
Gender Male
Status Offline
Thanks
Floor 4 Posted 2010-05-01 19:37 ·  中国 吉林 长春 联通
初级用户
Credits 69
Posts 46
Joined 2010-03-18 11:14
16-year member
UID 162446
Gender Male
From 山东
Status Offline
Just add @ at the beginning of the command line.
Floor 5 Posted 2010-05-01 19:43 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Command redirection operators (Redirection Operators) You can use redirection operators to redirect command input and output
> writes command output to a file or device (for example, a printer), instead of writing it in the command prompt window.
< reads command input from a file instead of from the keyboard.
>> appends command output to the end of a file without deleting the information in the file.
>& writes the output from one handle to the input of another handle.
<& reads input from one handle and writes it to the output of another handle.
| reads output from one command and writes it to the input of another command. Also called a pipe.
Forum Jump: