之前编辑文件都是用vim 命令,最近看视频学到一个用cat > 进行交互输入,感觉这样更方便
[email protected]:/home/koyaku# script create_file_use_cat.txt
Script started, file is create_file_use_cat.txt
[email protected]:/home/koyaku# cat createfile.txt
cat: createfile.txt: No such file or directory
[email protected]:/home/koyaku# cat > createfile.txt
a
b
c
d
end
u^Hend use ctrl +d
[email protected]:/home/koyaku# cat createfile.txt
a
b
c
d
end
end use ctrl +d
[email protected]:/home/koyaku#
ctrl-d: ( Terminate input, or exit shell ) 一个特殊的二进制值,表示 EOF,作用相当于在终端中输入exit后回车;
时间: 2024-10-12 12:41:16