这样,会像平时一样执行ls命令并将当前目录的文件名输出到标准输出。另外由于进行了tee命令,所以会生成一个test文件,这个test文件的内容和标准输出的内容一样。 【描述】 tee指令会从标准输入设备读取数据,将其内容输出到标准输出设备,同时保存成文件。可以用于既想看到标准输出,又想将标准输出保存到文件中的情况。 参数: -a或--append 附加到既有文件的后面,而非覆盖它. -i-i或--ignore-interrupts 忽略中断信号。 --help 在线帮助。 --version 显示版本信息。 常用参数 格式:tee 只输出到标准输出,因为没有指定文件嘛。 格式:tee file 输出到标准输出的同时,保存到文件file中。如果文件不存在,则创建;如果已经存在,则覆盖之。(If a file being written to does not already exist, it is created. If a file being written to already exists, the data it previously contained is overwritten unless the `-a" option is used.) 格式:tee -a file 输出到标准输出的同时,追加到文件file中。如果文件不存在,则创建;如果已经存在,就在末尾追加内容,而不是覆盖。 格式:tee - 输出到标准输出两次。(A FILE of `-" causes `tee" to send another copy of input to standard output, but this is typically not that useful as the copies are interleaved.)