1

i have the following files under test directory

.
./test2
./test2/test_doc1.txt
./test2/test1
./test2/test1/test_doc2.txt

when I use rm -rf test/**/test_doc2.txt, it does not remove the files. what is wrong?

xuhdev
  • 8,018
  • 2
  • 41
  • 69
pepero
  • 7,095
  • 7
  • 41
  • 72

1 Answers1

5

Assuming you are using Bash.

shopt -s globstar
rm -rf test/**/test_doc2.txt

Add shopt -s globstar to your ~/.bashrc file if you always want to enable this feature.

xuhdev
  • 8,018
  • 2
  • 41
  • 69