将控制台输出重定向到unix中的文件

Pra*_*hap 4 unix linux console redirect output

我一直在尝试使用find命令在我的ftp服务器中搜索文件

find ./* -iname "MyLog.log"
Run Code Online (Sandbox Code Playgroud)

我的输出量非常大.我正在尝试使用以下命令将此输出重定向到文件中.

find ./* -iname "MyLog.log"  > ./myfile/storeLog.log
Run Code Online (Sandbox Code Playgroud)

find ./* -iname "MyLog.log"  tee ./myfile/storeLog.log
Run Code Online (Sandbox Code Playgroud)

我仍然能够在控制台中看到输出但不能在文件中看到输出.

当我们在unix中使用find命令时,任何人都可以帮助我如何将输出重定向到文件.

sus*_*tus 7

可能大量输出是"允许拒绝"类型的消息.通过附加将错误重定向到日志文件2>&1.

2是stderr的流号(错误消息),1表示stdout流(标准的非错误输出流).

find . -iname "MyLog.log" > ./myfile/storeLog.log 2>&1
Run Code Online (Sandbox Code Playgroud)