How to delete all files except one in bash

1 · özkan pakdil · Aug. 5, 2021, 8:05 a.m.
I have been testing jhipster and its jdl, nice thing you can prepare a jdl file and it will generate all dao and pojos and admin panels. jhipster is generating a lot of files and I wanted to delete them all except the jdl file itself, here is how ls -a | grep -v test.jdl | xargs rm -rf ...