Search notes:

Shell command: nmcli

nmcli is a command-line tool for controlling the NetworkManager.

Connect to a new WiFi Hotspot

Show SSIDs
nmcli d wifi list
Connect to the WiFi hotspot/SSID. The following command prompts the user to enter the password in a dialog:
nmcli d wifi connect <ssid>
The password can also be stated non-interactively (note the keyword password):
nmcli d wifi connect <ssid> password <password>

Find available devices

nmcli device status
device and d are synonymous.

Installing in Debian/APT

nmcli is contained in the package network-manager.

Open a hotspot

In order to create a hotspot, the wifi adapter should support AP (=access point) mode.
If this is the case can be verified with
sudo iw list | grep -A 10 'Supported interface modes'
Create the hotspot (unfortunately, I was unable to connect to the hotspot created with the following command):
sudo nmcli device wifi hotspot con-name tq84-hotspot ssid tq84-ssid band bg password tq84-password
Show the hotspots' password (both as ASCII text and as QR code):
nmcli dev wifi show-password
Remove the hotspot:
sudo nmcli connection delete tq84-hotspot
Trying to create a hotspot like outlined in this stackexchange answer seemed to have more success (after I modified the 802-11-wireless-security.pmf parameter to 1).
Find the device name (in my case wlp111s0):
  nmcli device
Then set up the hotspot:
# sudo nmcli connection add type wifi ifname wlp111s0    con-name tq84-hotspot    autoconnect no  ssid tq84-ssid
  sudo nmcli connection add type wifi ifname wlp111s0    con-name tq84-hotspot    autoconnect yes ssid tq84-ssid
  sudo nmcli connection modify tq84-hotspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
  sudo nmcli connection modify tq84-hotspot wifi-sec.key-mgmt wpa-psk
  sudo nmcli connection modify tq84-hotspot wifi-sec.psk tq84password
  sudo nmcli connection modify tq84-hotspot 802-11-wireless-security.pmf 1
  sudo nmcli connection up tq84-hotspot

See also

nmtui
Networking in Linux.
Shell commands

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Linux/sh...', 1758200433, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Linux/shell/commands/nmcli(106): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78