Created
March 13, 2016 11:38
-
-
Save mael/2a62e1ee67fbbe525bd3 to your computer and use it in GitHub Desktop.
WIFI scan command linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Option 1 | |
sudo iwlist wlan0 scan | grep -oE '(ESSID:|Quality=).*' | |
#Option 2 | |
Create a bash file to filter command iwlist | |
#!/bin/bash | |
## print header lines | |
echo "" | |
echo "ESSID QUALITY" | |
while IFS= read -r line; do | |
## test line contenst and parse as required | |
[[ "$line" =~ Quality ]] && { | |
qual=${line##*ity=} | |
qual=${qual%% *} | |
lvl=${line##*evel=} | |
lvl=${lvl%% *} | |
} | |
[[ "$line" =~ ESSID ]] && { | |
essid=${line##*ID:} | |
echo " $essid $qual" # output after ESSID | |
} | |
done | |
#command execute -> sudo iwlist wlan0 scan | bash parseiwl.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment