cat、cp命令

cat是查看文件内容,

cp –cp是连目录及件文件都拷贝

cp是拷贝文件

a.txt里的内容是,

   abc

   def

   ghi

cat a.txt |grep –v ghi

得到结果,

   abc

   def

head -2 a.txt

得到结果,

   abc

   def

cat 1.txt 2.txt >3.txt

重镜像为3.txt

 

cat /dev/null >3.txt

cp -cp 源目录 目标目录

cp –ap ./c b/

1.txt原内容是I am zhouls,往1.txt里注入内容Good,

cat >>a/1.txt<<EOF

Good

EOF

显示结果,

I am zhouls

Good

猜你喜欢

转载自www.cnblogs.com/wangsongbai/p/9115713.html