So using the shell, and having a directory:
./parent
./parent/one
./parent/two
./parent/three
./parent/four
i want to do something like rm -rf parent/*
in one command, but keeping one directory, for example 'four', so the end result would be
./parent
./parent/four
Select multiple files or folders that are not grouped together. Click the first file or folder, and then press and hold the Ctrl key. While holding Ctrl , click each of the other files or folders you want to select.
Easiest and practical way in my opinion is to move the exception to parent folder, delete everthing move it back
mv exceptionFolder ..
rm -rf *
mv ../exceptionFolder .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With