문제

I am using zsh and I want to delete contents of a folder without deleting the folder itself. What is the best way to go about this?

도움이 되었습니까?

해결책

rm -r myfolder/* will delete all files in that folder that do not begin with a dot.

Really the simplest solution is rm -rf myfolder && mkdir myfolder.

다른 팁

You can just use rm -r path/to/dir/*.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top