iSteve Posted January 6, 2021 Posted January 6, 2021 Hi all, I need a script to look in to a folder and delete all it's contents apart from two folders. I am using the following shopt -s extglob cd /Users rm -rf !(administrator) ...which removes everything apart from a folder called "administrator", however I want it to delete everything apart from "administrator" and "Shared" how do I structure the syntax to define a second exclusion? Thanks
iSteve Posted January 18, 2021 Author Posted January 18, 2021 In case anyone digs this up, another user said that the syntax should be shopt -s extglob cd /Users rm -rf !(administrator|Shared)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now