Nguyễn Văn Toàn
New member
How do I remove all files from a directory in Unix?
Answer
To delete all files and directories(including the hidden ones) in a directory, you can try the following:
Answer
To delete all files and directories(including the hidden ones) in a directory, you can try the following:
- use ls -Ab to match all files/directories cd dir_name && rm -rf `ls -Ab`
- use find to match all files/directories find dir_name -mindepth 1 -delete.