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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI'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?
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\*