红联Linux门户
Linux帮助

关于Linux下清空脚本内容的方法

发布时间:2015-10-26 15:43:57来源:linux网站作者:hhbgk

如果想重复使用一个脚本,而不是老是用 rm -r filename 然后又重建一个,就可以用下面的方法:


$ > filename
$ echo “” > filename
$ echo /dev/null > filename
$ echo > filename
$ cat /dev/null > filename


知识有限,不知道还有没有其它的方法。


使用shell脚本清空文件:http://www.linuxdiyf.com/linux/14991.html

学习写linux脚本:http://www.linuxdiyf.com/linux/13971.html