Home  >  Article  >  Operation and Maintenance  >  How to quickly clear files in linux

How to quickly clear files in linux

PHPz
PHPzforward
2023-05-11 21:04:041484browse

Use the /dev/null method:

The code is as follows:

ct /dev/null >! file

or

bash: cat /dev/null >| file

The simpler way is

>| file

What versions of Linux are there?

Linux versions include: Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and other versions. Among them, Deepin is one of the best-developed Linux distributions in China; Ubuntu Kylin is a derivative distribution based on Ubuntu; Manjaro is a Linux distribution based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP and is simple and easy to use; Ubuntu is a desktop application Mainly Linux operating system.

The above is the detailed content of How to quickly clear files in linux. For more information, please follow other related articles on the PHP Chinese website!

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