I am trying to write maintainer scripts for debian
package.
Assume that I have a directory structure as follows:
application/
----application/file1.txt
----application/file2.txt
----application/config
--------application/config/c1.conf
--------application/config/c2.conf
----application/logs
--------application/logs/l1.txt
--------application/logs/l2.txt
----application/src
--------application/src/static/
------------application/src/static/js
------------application/src/static/css
--------application/src/s1.py
--------application/src/s2.py
----application/lib
--------application/src/js/
--------application/src/css/
Now I want to delete all the files/folders except config
and logs
(in this case, src
and lib
folders, and file1.txt
and file2.txt
files). My PWD
is currently a parent of appliaction/
dir (i.e., I can see application
in my PWD
).
What command should I use (a small bash script
would be great)? (I tried with rm -rf
with some options but mistakenly deleted other files, so I would like to know the correct answer before trying anything else!)
rm
(see my answer). – Equable