How to delete contents in a folder using bash script?

I would like to clear the my / bin folder in my project directory. How can i do this?

I tried rm -rf ~/binbut no luck

+5
source share
2 answers

You should say "... folder with my bin", not "my / bin folder". /bin- absolute path, bin- relative path.

rm -rf ~/bindeletes $HOME/bin, so not what you want.

Now, it depends on where you are: if you are in your project directory when entering a command, just type rm -rf bin.

+7
source

~ . , , - . ,

rm -rf ~/bin/*

rm -rf ~/bin/.[a-z]*

,

rm -rf ~/bin/.*

a >

root, .

+9

All Articles