Get connected Wi-Fi network signal strength with nmcli

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I'm able to get the signal strength of all Wi-Fi networks with the following command:



$ nmcli -t -f SIGNAL device wifi list
$ 77
67
60
59
55
45
44
39
39
37


I would like to reduce this list only to the current Wi-Fi on which I'm connected. I've been through the man page but can't find the necessary flag.



One solution would be to use sed or awk, but I would like to avoid piping.



Should I use nmcli device wifi instead of parsing directly for the SIGNAL column?










share|improve this question







New contributor




Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    Use iwconfig instead.
    – Ipor Sircer
    Nov 22 at 9:52










  • Or use the never iw scan etc. instead of the older iwconfig.
    – dirkt
    Nov 22 at 10:15














up vote
3
down vote

favorite












I'm able to get the signal strength of all Wi-Fi networks with the following command:



$ nmcli -t -f SIGNAL device wifi list
$ 77
67
60
59
55
45
44
39
39
37


I would like to reduce this list only to the current Wi-Fi on which I'm connected. I've been through the man page but can't find the necessary flag.



One solution would be to use sed or awk, but I would like to avoid piping.



Should I use nmcli device wifi instead of parsing directly for the SIGNAL column?










share|improve this question







New contributor




Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 1




    Use iwconfig instead.
    – Ipor Sircer
    Nov 22 at 9:52










  • Or use the never iw scan etc. instead of the older iwconfig.
    – dirkt
    Nov 22 at 10:15












up vote
3
down vote

favorite









up vote
3
down vote

favorite











I'm able to get the signal strength of all Wi-Fi networks with the following command:



$ nmcli -t -f SIGNAL device wifi list
$ 77
67
60
59
55
45
44
39
39
37


I would like to reduce this list only to the current Wi-Fi on which I'm connected. I've been through the man page but can't find the necessary flag.



One solution would be to use sed or awk, but I would like to avoid piping.



Should I use nmcli device wifi instead of parsing directly for the SIGNAL column?










share|improve this question







New contributor




Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I'm able to get the signal strength of all Wi-Fi networks with the following command:



$ nmcli -t -f SIGNAL device wifi list
$ 77
67
60
59
55
45
44
39
39
37


I would like to reduce this list only to the current Wi-Fi on which I'm connected. I've been through the man page but can't find the necessary flag.



One solution would be to use sed or awk, but I would like to avoid piping.



Should I use nmcli device wifi instead of parsing directly for the SIGNAL column?







linux nmcli






share|improve this question







New contributor




Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 22 at 9:36









Grégoire Borel

1183




1183




New contributor




Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Grégoire Borel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 1




    Use iwconfig instead.
    – Ipor Sircer
    Nov 22 at 9:52










  • Or use the never iw scan etc. instead of the older iwconfig.
    – dirkt
    Nov 22 at 10:15












  • 1




    Use iwconfig instead.
    – Ipor Sircer
    Nov 22 at 9:52










  • Or use the never iw scan etc. instead of the older iwconfig.
    – dirkt
    Nov 22 at 10:15







1




1




Use iwconfig instead.
– Ipor Sircer
Nov 22 at 9:52




Use iwconfig instead.
– Ipor Sircer
Nov 22 at 9:52












Or use the never iw scan etc. instead of the older iwconfig.
– dirkt
Nov 22 at 10:15




Or use the never iw scan etc. instead of the older iwconfig.
– dirkt
Nov 22 at 10:15










2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










To get the SIGNAL of the AP on which you are connected use:



nmcli dev wifi list | awk '/*/if (NR!=1) print $7'


The second * mark in nmcli dev wifi list is set to identify the SSID on which your are connected.



nmcli --version
nmcli tool, version 1.6.2





share|improve this answer


















  • 1




    It works for me if I use print $6 instead of print $7.
    – Grégoire Borel
    Nov 22 at 10:28







  • 2




    @GrégoireBorel Great! it depend on nmcli version.
    – GAD3R
    Nov 22 at 10:30










  • Debugging failing scripts if it depends on the nmcli version will be fun...
    – dirkt
    Nov 22 at 11:27

















up vote
0
down vote













If you know the name of the network you're connected to, you could modify your approach like this:



nmcli -t -f SSID,SIGNAL | grep "^<network name>:" | cut -d : -f 2





share|improve this answer




















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Grégoire Borel is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483396%2fget-connected-wi-fi-network-signal-strength-with-nmcli%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    To get the SIGNAL of the AP on which you are connected use:



    nmcli dev wifi list | awk '/*/if (NR!=1) print $7'


    The second * mark in nmcli dev wifi list is set to identify the SSID on which your are connected.



    nmcli --version
    nmcli tool, version 1.6.2





    share|improve this answer


















    • 1




      It works for me if I use print $6 instead of print $7.
      – Grégoire Borel
      Nov 22 at 10:28







    • 2




      @GrégoireBorel Great! it depend on nmcli version.
      – GAD3R
      Nov 22 at 10:30










    • Debugging failing scripts if it depends on the nmcli version will be fun...
      – dirkt
      Nov 22 at 11:27














    up vote
    3
    down vote



    accepted










    To get the SIGNAL of the AP on which you are connected use:



    nmcli dev wifi list | awk '/*/if (NR!=1) print $7'


    The second * mark in nmcli dev wifi list is set to identify the SSID on which your are connected.



    nmcli --version
    nmcli tool, version 1.6.2





    share|improve this answer


















    • 1




      It works for me if I use print $6 instead of print $7.
      – Grégoire Borel
      Nov 22 at 10:28







    • 2




      @GrégoireBorel Great! it depend on nmcli version.
      – GAD3R
      Nov 22 at 10:30










    • Debugging failing scripts if it depends on the nmcli version will be fun...
      – dirkt
      Nov 22 at 11:27












    up vote
    3
    down vote



    accepted







    up vote
    3
    down vote



    accepted






    To get the SIGNAL of the AP on which you are connected use:



    nmcli dev wifi list | awk '/*/if (NR!=1) print $7'


    The second * mark in nmcli dev wifi list is set to identify the SSID on which your are connected.



    nmcli --version
    nmcli tool, version 1.6.2





    share|improve this answer














    To get the SIGNAL of the AP on which you are connected use:



    nmcli dev wifi list | awk '/*/if (NR!=1) print $7'


    The second * mark in nmcli dev wifi list is set to identify the SSID on which your are connected.



    nmcli --version
    nmcli tool, version 1.6.2






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 22 at 10:28

























    answered Nov 22 at 10:25









    GAD3R

    24.6k1749103




    24.6k1749103







    • 1




      It works for me if I use print $6 instead of print $7.
      – Grégoire Borel
      Nov 22 at 10:28







    • 2




      @GrégoireBorel Great! it depend on nmcli version.
      – GAD3R
      Nov 22 at 10:30










    • Debugging failing scripts if it depends on the nmcli version will be fun...
      – dirkt
      Nov 22 at 11:27












    • 1




      It works for me if I use print $6 instead of print $7.
      – Grégoire Borel
      Nov 22 at 10:28







    • 2




      @GrégoireBorel Great! it depend on nmcli version.
      – GAD3R
      Nov 22 at 10:30










    • Debugging failing scripts if it depends on the nmcli version will be fun...
      – dirkt
      Nov 22 at 11:27







    1




    1




    It works for me if I use print $6 instead of print $7.
    – Grégoire Borel
    Nov 22 at 10:28





    It works for me if I use print $6 instead of print $7.
    – Grégoire Borel
    Nov 22 at 10:28





    2




    2




    @GrégoireBorel Great! it depend on nmcli version.
    – GAD3R
    Nov 22 at 10:30




    @GrégoireBorel Great! it depend on nmcli version.
    – GAD3R
    Nov 22 at 10:30












    Debugging failing scripts if it depends on the nmcli version will be fun...
    – dirkt
    Nov 22 at 11:27




    Debugging failing scripts if it depends on the nmcli version will be fun...
    – dirkt
    Nov 22 at 11:27












    up vote
    0
    down vote













    If you know the name of the network you're connected to, you could modify your approach like this:



    nmcli -t -f SSID,SIGNAL | grep "^<network name>:" | cut -d : -f 2





    share|improve this answer
























      up vote
      0
      down vote













      If you know the name of the network you're connected to, you could modify your approach like this:



      nmcli -t -f SSID,SIGNAL | grep "^<network name>:" | cut -d : -f 2





      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        If you know the name of the network you're connected to, you could modify your approach like this:



        nmcli -t -f SSID,SIGNAL | grep "^<network name>:" | cut -d : -f 2





        share|improve this answer












        If you know the name of the network you're connected to, you could modify your approach like this:



        nmcli -t -f SSID,SIGNAL | grep "^<network name>:" | cut -d : -f 2






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 at 10:06









        telcoM

        14.5k11842




        14.5k11842




















            Grégoire Borel is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            Grégoire Borel is a new contributor. Be nice, and check out our Code of Conduct.












            Grégoire Borel is a new contributor. Be nice, and check out our Code of Conduct.











            Grégoire Borel is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483396%2fget-connected-wi-fi-network-signal-strength-with-nmcli%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay