Re: I need help with "nmcli device status"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi All,
>
> I am trying to use the nmcli command to cough up
> (a highly technical term) the connected state on
> a particular network interface.
>
> According to the man page:
>
>      nmcli device {status | show | set | connect | reapply
>                   | modify | disconnect | delete | monitor |
>                   wifi | lldp}  [ARGUMENTS...]
> ...
>
>      status
>          Print status of devices.
>
>          This is the default action if no command is
>          specified to nmcli device.
>
> So here goes without the device:
>
>      $ nmcli device status
>      DEVICE      TYPE      STATE        CONNECTION
>      br0         bridge    connected    System br0
>      virbr0      bridge    connected    virbr0
>      eno2        ethernet  connected    eno2
>      eno1        ethernet  unavailable  --
>      lo          loopback  unmanaged    --
>      virbr0-nic  tun       unmanaged    --
>
> So far so good.
>
> Now the specify as "specified" device:
>
>      $ nmcli device status eno2
>       Error: invalid extra argument 'eno2'.
>
> Okay, what am I doing wrong/misreading?
>
> Yes, I know I can use grep and awk.  I will be
> using Raku though:
>
>       $ nmcli device status | raku -ne 'for $_.lines -> $I
>         { if $I.contains( "connected" & "eno2" )
>         { say "connected"; last }}'
>
>       connected
>
>
> Many thanks,
> -T
>
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct:
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
> https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
>

use show (instead of status)

Try this:

nmcli device show eno2

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux