Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Is there a command where, when entered outputs information such as:

  • If the network connection is wired or wireless
  • if it is a wireless network, the name of the wireless network
  • How strong the signal is
share|improve this question

2 Answers 2

up vote 2 down vote accepted

Just type in terminal 'iw' and then press Tab and you will see something like iw iw iwconfig iwevent iwgetid iwlist iwpriv iwspy all those are related to wireless internet, try iwconfig to show statistic about signal and network interface.

share|improve this answer

You can make this a shell script for the first question:


if ! /bin/ip route | grep -q ^default; then
  echo "No Internet connection"
  exit 0
if="$(/bin/ip route | 
  awk '$1 == "default" {for (i=2;i<=NF;i++) if ($i == "dev") { i++;print $i; exit}}')"
if [ -z "$if" -o \! -e /sys/class/net/"$if" ]; then
  echo "Sorry, some error, aborting."
  exit 1
if /usr/sbin/iw dev "$if" info &>/dev/null; then
  echo "The Internet connection is wireless."
  # uncomment the next line to start iwconfig
  # iwconfig
  echo "The Internet connection is wired."

You can save this as e.g. ~/scripts/, make it executable via chmod a+x ~/scripts/ and easily call it by making an alias definition (in e.g. ~/.alias): alias inetinfo="~/scripts/"

share|improve this answer
The above script as a wgettable pastebin: – starbeamrainbowlabs Apr 8 '14 at 14:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.