且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

cat< file和cat文件之间有什么区别?

更新时间:2023-11-06 11:40:40

使用cat < filecat会从其标准输入中读取内容; Shell将打开文件,并将文件句柄连接到cat.使用cat filecat本身无需任何外壳程序即可打开文件.两者的最终结果确实是相同的:cat读取file的内容并将其输出到标准输出.

With cat < file, cat reads from its standard input; the shell opens the file and connects the file handle to cat. With cat file, cat itself opens the file without any shell involvement. The end result is indeed the same for both: cat reads the contents of file and outputs them to standard output.