⌨️Terminal

WLAN Pi / Linux terminal commands and a few concepts thrown in for good measure

You do not need to learn these commands, nor do you need to become a wizard with the command line to make good use your WLAN Pi, but we do want you to become familiar and comfortable with executing commands from the terminal.

Basic Cursor Navigation

Use the following shortcuts to quickly move the cursor around the current line while typing a command.

Ctrl+A or Home: Go to the beginning of the line

Ctrl+E or End: Go to the end of the line

Ctrl+xx: Move between the beginning of the line and the current position of the cursor. This allows you to press Ctrl+xx to return to the start of the line, change something, and then press Ctrl+xx to go back to your original cursor position.

To use this shortcut, hold the Ctrl key and tap the X key twice.

Windows:

Ctrl+ <-: Go left (back) one word

Ctrl+ ->: Go right (forward) one word

macOS:

Esc+B / Esc+ <- / Alt+ <- : Go left (back) one word

Esc+F / Esc+ -> / Alt+ -> : Go right (forward) one word

Check operating system version

Check the WLAN Pi OS version:

wlanpi-stats

Show me the version of Linux you are running:

lsb_release -a

What Linux kernel are we using:

uname -r

View Interface IP Addresses

View all your interfaces and IP addresses

ip address

View IP address for a specific interface

ip address show eth0
ip address show wlan0

View IP neighbor table (ARP cache)

ip neighbor

View IP routing table

ip route

View wireless devices

iw dev

View wireless device capabilities

iw list

You'll get a lot of info printed to the terminal. View it page by page with less:

iw list | less

Exit by pressing q key

Command history

View a list of your previously executed commands with:

history

Re-execute a command from the history, use exclamation mark followed by x, which represents the desired command list number:

!x

Sudo bang bang

When you enter a command that requires sudo (like reboot), but you forgot! No need to retype the command. Just do this instead:

sudo !!

Tab complete

Complete commands and file paths by starting to type them out, then using the tab key to auto-complete:

hi<tab>

Which becomes:

history

When there are multiple possibilities, double tapping the tab key will list all the possibilities. Try this to see all the wlanpi custom commands:

wlanpi<tab><tab>

pwd

Print working directory, ever feel lost as to where you are?

pwd

Enumeration commands

whoamiode
hostname

wifichannel

wifichannel -h

You can quickly:

  • Convert between channel number <--> centre frequency

  • List all Wi-Fi channels in a specific band

passwd

You can change your password from the terminal (but only if you want to):

passwd

This is how you can change your password at a later date.

Linux Cheat Sheet

Useful Linux commands, if you have time / want to go deeper.

Last updated