Linux清空文本内容

测试文件:test.txt

第一种:

$> test.txt

Linux清空文本内容

第二种:

$echo "" > test.txt

Linux清空文本内容

第三种:

$cat /dev/null > test.txt

Linux清空文本内容