I would like to remove all content of the current working directory. How to do it in efficient and elegant way?
I have several files, directories and some of them starts with dot, like:
touch .abc; touch abcd ; mkdir foobar; touch "file name" "#"
I am looking for posix compatible, elegant solution, to make this directory empty. I will post some of my ideas, but none of them are perfect.
d=$(basename `pwd`); cd .. && rm -rf ./${d} && mkdir ${d} && cd -
– devnull Apr 11 '13 at 12:46d=$(basename `pwd`); cd .. && mktemp -p ./${d} && rm -rf ./${d} && mkdir ${d} && cd -
– devnull Apr 11 '13 at 13:36