Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    trying to only output certain words from a command

    hi im trying to find a way to only show the interface name and interface mode from the iwconfig command.

    for example this is the output i get.

    lo        no wireless extensions.
    eth0      no wireless extensions.
    wlan1     IEEE 802.11bg  ESSID:"*****"  
              Mode:Managed  Frequency:2.437 GHz  Access Point: 00:FE:F4:6A:85:48   
              Bit Rate=48 Mb/s   Tx-Power=20 dBm   
              Retry  long limit:7   RTS thr:off   Fragment thr:off
              Power Management:off
              Link Quality=70/70  Signal level=-14 dBm  
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:14  Invalid misc:80   Missed beacon:0
    and i want to get it to output.

    wlan0 managed
    wlan1 managed
    for however many wireless interfaces there is

  2. #2
    Linux Enthusiast
    Join Date
    Dec 2011
    Turtle Island West
    Try this (or a minor variant):
    iwconfig | grep -A1 wlan | tr -d '\n' | tr -s [:blank:] | cut -d ' ' -f 1,5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts