[Seek Help] 如何把cmake的输出重定向到文本文件里面?
Tofloor
poster avatar
Lwh2008-Equinox
deepin
2023-07-31 01:02
Author

如题,因为有的时候求助他人时需要给输出信息,但是直接截屏太麻烦了(而且ssh有行数限制)

不清楚怎么搞

Reply Favorite View the author
All Replies
wlly-lzh
deepin
2023-07-31 01:05
#1

make xxx > 记录.txt

xxx是操作,>是重定向符号。

Reply View the author
wlly-lzh
deepin
2023-07-31 01:07
#2

也可以这样

make xxx | tee 记录.txt | cat

这样可以同时记录和现实

Reply View the author
Ziggy
deepin
2023-07-31 08:16
#3

命令末尾加

> ./xxx.txt

一般就会将输出信息保存到指定文件里

Reply View the author
neko
deepin
Ecological co-builder
2023-07-31 15:34
#4
wlly-lzh

也可以这样

make xxx | tee 记录.txt | cat

这样可以同时记录和现实

后面的 | cat其实不用

Reply View the author
owen_337
deepin testing team
2023-07-31 22:55
#5

cmake xxx > xxx.log 2>&1 加上 2>&1吧,表示将标准错误输出(文件描述符2)重定向到与标准输出相同的地方(即同样写入到文件中)。

Reply View the author