#用tail命令监听并显示文件内容,然后再打开一个终端用重定向修改文件
命令如下:
tail -f 4.txt
echo “hello world” >> 4.txt ------>>意为在文件后面添加内容
echo “hello world” > 4.txt ------>意为添加的内容会覆盖之前的内容
tail监听文件界面
执行echo “hello world” >> 4.txt 后界面
执行echo “hello world” > 4.txt 后界面
#用tail命令监听并显示文件内容,然后再打开一个终端用重定向修改文件
命令如下:
tail -f 4.txt
echo “hello world” >> 4.txt ------>>意为在文件后面添加内容
echo “hello world” > 4.txt ------>意为添加的内容会覆盖之前的内容
tail监听文件界面
执行echo “hello world” >> 4.txt 后界面
执行echo “hello world” > 4.txt 后界面
相关文章: