B
B
Bogdan2018-06-21 19:42:48
linux
Bogdan, 2018-06-21 19:42:48

Delete all files except folder and file?

Gentlemen, can you tell me how to delete all the files in the directory and leave only one folder with all the files, and one file in another folder?
You need to leave the src directory with files
and one public/index.html file.
This does not work.
rm -rf ./!(src|public/index.html)
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-06-21
@Tabletko

find --exclude --delete

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question