1

I'd like to list let's say all of the following interfaces:

  • p4p1
  • p4p2
  • p4p3
  • p4p4

Instead of doing something like this:

for i in {1..4}; do ip a s p4p${i}; done

can I just do something similar to:

ip a s p4p*

and achieve the same effect?

6

According to ip addr help:

[...]
ip addr {show|save|flush} [ dev STRING ] [ scope SCOPE-ID ]
                     [ to PREFIX ] [ FLAG-LIST ] [ label PATTERN ] [up]
[...]

You can use:

ip addr show label p4p\*
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.