I’m scared that one day, I’m going to put a space or miss out something in the command I currently use:
rm -rf ./*
Is there a safer way of emptying the current directory’s contents?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The safest way is to sit on your hands before pressing Enter.
That aside, you could create an alias like this one (for Bash)
That will show you your directory, wait for an enter press and then remove what you specified with the proper flags. You can cancel by pressing ^C instead of Enter.