简体   繁体   中英

Print command line output into a text file in Linux (Ubuntu)

I have a C++ program in Linux (Ubuntu) which prints very long output in a command terminal.

How can i copy this output from command terminal directly to the .txt file by Linux command?

您的外壳程序通过输出重定向为您完成此操作:

$ ./a.out > theoutput.txt

In general you type;

command > file.txt

The greater than symbol > redirects standard out to the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM