Remove files that start with but don't contain
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm trying to remove a lot of files at once but need to be specific as to not remove any of the files I actually need.
I have a ton of corrupt files that start master- but there are valid files that start with master-2018
So, I want to do something like
rm -rf master-* --exclude master-2018*
Is that I need possible?
linux rm delete
New contributor
add a comment |Â
up vote
0
down vote
favorite
I'm trying to remove a lot of files at once but need to be specific as to not remove any of the files I actually need.
I have a ton of corrupt files that start master- but there are valid files that start with master-2018
So, I want to do something like
rm -rf master-* --exclude master-2018*
Is that I need possible?
linux rm delete
New contributor
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to remove a lot of files at once but need to be specific as to not remove any of the files I actually need.
I have a ton of corrupt files that start master- but there are valid files that start with master-2018
So, I want to do something like
rm -rf master-* --exclude master-2018*
Is that I need possible?
linux rm delete
New contributor
I'm trying to remove a lot of files at once but need to be specific as to not remove any of the files I actually need.
I have a ton of corrupt files that start master- but there are valid files that start with master-2018
So, I want to do something like
rm -rf master-* --exclude master-2018*
Is that I need possible?
linux rm delete
linux rm delete
New contributor
New contributor
New contributor
asked 2 mins ago
Dan James Palmer
1011
1011
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Use find:
find . ! -name "master-2018*" -delete
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Use find:
find . ! -name "master-2018*" -delete
add a comment |Â
up vote
0
down vote
Use find:
find . ! -name "master-2018*" -delete
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Use find:
find . ! -name "master-2018*" -delete
Use find:
find . ! -name "master-2018*" -delete
answered 1 min ago
Ipor Sircer
9,8711921
9,8711921
add a comment |Â
add a comment |Â
Dan James Palmer is a new contributor. Be nice, and check out our Code of Conduct.
Dan James Palmer is a new contributor. Be nice, and check out our Code of Conduct.
Dan James Palmer is a new contributor. Be nice, and check out our Code of Conduct.
Dan James Palmer is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480241%2fremove-files-that-start-with-but-dont-contain%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password