But, I would count this a bug in ifconfig. I’ve never seen for years (since Wifi exists in FreeBSD and Linux) an ifconfig not showing the Wifi SSID, etc.
For what it’s worth, with the computer I’m sitting on at the moment (not a Librem 5 and not running PureOS and hasn’t had a major version change in 2 years) … ifconfig does not show the SSID. So this is not unique to the Librem 5 or to PureOS.
Maybe there is some option that you enable and I don’t.
I thought ifconfig has been deprecated for years for most Linux distros in favor of the ip command (part of the iproute2 package).
I thought for wlan’s one was supposed to use iwgetid or iwgetid -r instead of grepping an inconsistent/undefined content (and interface names) from other commands.
You are right. However the OP asked, so I tried to investigate whether it has really changed.
As far as random grepping goes, a better version of the above command suggested by me would be
nmcli -g 802-11-wireless.ssid conn show $uuid
It depends whether the OP just wanted to see the information (confirm what SSID the device is associated with) or wanted to use it reliably in a script.
Interface names should now be predictable - for those distros that have enabled that option and not overridden it for the given interface. However the problem that this was designed to solve is unlikely to occur on a Librem 5.
purism@pureos:~$ nmcli -g 802-11-wireless.ssid conn show $uuid
Error: invalid field '802-11-wireless.ssid'; allowed fields: NAME,UUID,TYPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,AUTOCONNECT-PRIORITY,READONLY,DBUS-PATH,ACTIVE,DEVICE,STATE,ACTIVE-PATH,SLAVE,FILENAME.
I don’t know if I’d call ifconfig deprecated. It is in any case more easy to use ifconfig wlan0 or if one does not know the name of the interface, just ifconfig -a to verify SSID and IP addr.
Doesn’t matter. The cut command is grabbing field 1, which is why I put the field, uuid, first, so it doesn’t matter how many spaces there are after the UUID. Of course, since a UUID always has the same length, you can just cut the right number of characters if you prefer.
I believe that ifconfig (from net-tools) is no longer installed by default on Debian (Debian 10 and later). Here is an article about 6 deprecated commands: 6 Deprecated Linux Commands and Alternative Tools for Linux . I was surprised to note that scp was in that list. I wasn’t surprised to see arp and route in there (also both replaced by the ip command with “ip neighbor” and “ip route”).
Also … did you fail to note that while ifconfig seems to be giving the SSID on BSD, it isn’t working that way on the Librem 5. That’s part of the problem.
Non-standard output, behavior, and returned error codes is why net-tools like “ipconfig” and “route” became deprecated. They were hard to reliably script.
I don’t know if ifconfig on linux ever produced the SSID — maybe “ifconfig wlan up scan” would have a better chance.
Conceptually there may be merit in limiting a tool to one layer in the network stack. In other words, if a tool is mainly concerned with sorting out IP (layer 3 i.e. IP addressing and routing) it should not be concerned with the details of layer 2 (including in the case of WiFi: BSSID, SSID, keys, authentication, encryption, …), never mind about layer 1 (in the case of WiFi: OTA protocol, frequency, transmit power).
So perhaps there is a conflict between purity and convenience.
Is it just me or could this perhaps have been less painfully named?