很多時(shí)候需要將Linux shell上的內(nèi)容導(dǎo)出到文件中(比如覆履,log日志打印);或者將文件中的內(nèi)容導(dǎo)入當(dāng)前的工作環(huán)境峻汉。
導(dǎo)入
<
即可
比如:
clip < ~/.ssh/id_rsa.pub
悲立,將文件中保存的rsa
公鑰導(dǎo)入剪切板中并思,或者在MacOs 中使用pbcopy < ~/.ssh/id_rsa.pub
導(dǎo)出
導(dǎo)出分為覆蓋和追加兩種形式:
>
覆蓋模式喉刘,相當(dāng)于重建個(gè)新文件覆蓋掉老文件瞧柔;
>>
追加模式,相當(dāng)于打開(kāi)原文件睦裳,在里面加上新內(nèi)容造锅。
比如:
hive -e "set hive.cli.print.header=true; select * from some_data_table limit 3" | sed 's/[\t]/,/g' > hhd.csv