且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 shell 脚本删除文件夹的内容

更新时间:2023-12-05 18:11:58

全局扩展不会发生在引号内.

Glob expansion doesn't happen inside quotes.

试试:

rm -r -- "$DIR"*

(请确保不要在引号后加空格.)

(Just make really sure you don't put a space after the quotes.)