|
有多少中方法可以把文件打印到stdout,模拟cat。只考虑文本文件。
sed ""
sed h
sed -n p
awk '{print}'
awk /^/
awk /$/
grep '^'
grep '$'
perl -ne print
perl -pe ""
cut -c1-
pr -t
tail +0
comm file /dev/null
cp file /dev/stdout
cp file `tty`
ul #这个是不是要取决于终端类型?
strings
用到重定向:
paste - <file
tee <file
tr a a <file #a a可以是任意相同字符
用到管道(没什么意思,聊备一格)
gzip -c file | zcat
bzip2 -c file | bzcat
diff file /dev/null | sed -e 1d -e 's/^< //'
...
请补充。 |
|