Linux 写入查看文本

写入文本

echo 'ddddd'> a.txt

echo 'dddd'>> a.txt

查看文本

cat  a.txt,展示所有信息,有可能会非常长

head a.txt 展示前10行信息

head -3 a.txt 展示前三行

tail a.txt 展示倒数10行(按照原有的顺序)

tail -3 a.txt 展示倒数3行(按照原有的顺序)

tail -f a.txt 如果a的文件有更新,更新结果会实时出行在中断。

wc a.txt 展示文本统计

more a.txt/less a.txt

猜你喜欢

转载自www.cnblogs.com/Brake/p/12173734.html
今日推荐