pri*_*rre 22
这种方法有很多误解,因为使用-作为参数引用STDIN/STDOUT即dev/stdin或dev/stdout.所以如果要打开这种类型的文件,你必须指定文件的完整位置,如as ./-.例如.,如果你想查看该文件中的内容,请使用cat ./-
小智 5
看起来该rev命令不被视为-特殊字符。
从手册页
The rev utility copies the specified files to standard output, reversing the order of characters in every line.
Run Code Online (Sandbox Code Playgroud)
所以
rev - | rev
应该以正确的顺序显示文件中的内容。