How to use the command line to clear files under macos

王林
Release: 2020-12-02 14:43:37
forward
4808 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template