命令行中向一个文件插入多行

命令行中向一个文件插入多行

1
2
3
4
5
6
7
8
9
10
11
12
13
# possibility 1:
echo "line 1" >> greetings.txt
echo "line 2" >> greetings.txt

# possibility 2:
echo "line 1
line 2" >> greetings.txt

# possibility 3:
cat <<EOT >> greetings.txt
line 1
line 2
EOT