I would like to clear out my /bin folder in my project directory. How can I do this?
I tried rm -rf ~/bin
but no luck
Right-click the folder you want to delete and click Delete Folder. Click Yes to move the folder and its contents to the Deleted Items folder. When you empty the Deleted Items folder, everything in it — including any folders you've deleted — is permanently erased.
~ is a shorthand to a current user home directory. So unless it's also your project directory you are doing something wrong. Other than that, clearing a directory would be
rm -rf ~/bin/*
And if you also want to clear the hidden files
rm -rf ~/bin/* ~/bin/.[a-zA-Z0-9]*
Make sure you are not doing
rm -rf ~/bin/.*
especially as root as it will try to clear out your entire system.
UPD
Why? Since wildcard (*
) is interpreted by shell as zero or more characters of any kind the .*
will also match .
(current directory) and ..
(parent directory), which will result in going all the way up and then down, trying to remove each file in your filesystem tree.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With