Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement content redirection with dos

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces dos how to achieve content redirection, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Is there a way to save the help information displayed in the command line window?

The answer is yes, and there is more than one answer.

A slightly more tedious way is to copy the information from the command line window and paste it into the text to save it. This operation is more tedious: right-click in the command line window, then select "tag", use the mouse to pull out the copy range, and then hit enter, and finally, paste into the text.

An efficient way is to use redirect symbols to redirect the information originally output to the cmd window to a text file.

There are two redirect symbols: > and > >. Their function is to change the output direction of all kinds of prompts and output them to a specified place-all kinds of prompts are output to the screen by default. For example: tree /? > help.txt, this command statement redirects the help information of the tree command to the help.txt file, and help > nul redirects the prompt information of the help command to the empty device (nul represents the empty device).

Want to see what basic commands are available in cmd? You can see it by typing help in the cmd window; if you want to save these basic command information, use help > d:\ list.txt, and then go to the root directory of D disk to find the list.txt file and open it.

> and > > although both play the role of redirecting prompts, their roles are slightly different. A single > means to redirect the prompt message by overwriting, that is, if the destination originally has content, the original content will be cleared and filled with new content; > > means to redirect the prompt message by appending, that is, if the destination has original content, the original content will remain unchanged and new content will be appended to the original content. For example, suppose the content in d:\ test.txt is: I Love batch. Then, in the cmd window, use the following two statements: echo me,too > d:\ test.txt and echo me,too > d:\ test.txt, respectively, and you will find that after using the first statement, there is only one line in test.txt: me,too, while after using the second statement, there will be two items in test.txt, I Love batch and me,too.

Thank you for reading this article carefully. I hope the article "how to achieve content redirection in dos" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report