Home  >  Article  >  Operation and Maintenance  >  How to use the command line to clear files under macos

How to use the command line to clear files under macos

王林
王林forward
2020-12-02 14:43:374798browse

How to use the command line to clear files under macos

Command to completely clear the file:

(Related recommendations: macos)

//注意冒号:是占位符
$ :>filename
$ cat /dev/null > filename
$ cp /dev/null filename

If you don’t mind empty lines inside or space, you can also use the following command:

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

The above is the detailed content of How to use the command line to clear files under macos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete