L
L
lapka-admin2018-07-16 22:47:48
linux
lapka-admin, 2018-07-16 22:47:48

Is there an OR in linux commands?

When I enter the command
rm -rf file_1*
Is it possible to specify instead of just the number 1, for example 1 or 2, in regular expressions it would be (1|2) for example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2018-07-16
@lapka-admin

Actually it depends on the shell. You probably have bash, so man bash has an EXPANSION section, specifically Pathname Expansion.
In this case file_[12]* should work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question