When SSHing into my DD-WRT router (Buffalo WHR-HP-G54) with embedded Linux to browse the DHCP Lease list I get strange characters:~ # more /tmp/udhcpd.leasesx_     iPhone-de-Tomaz                       e2}'                               dandroid-44bb0dfe552c0cc5$uR                                                             '                                                               g)Dess-iPadx@K                                                                                handroid-2a1b5edae9710ben                          Gandroid-44fa2b3cf7135ebd88Y                                                           jandroid-52f86ace6acd8137HZ?G:|         k$android-607ba415a5ab90e5                                        lLiyanaRnsiPhoneoS                                                               m@:This did not happen with the DD-WRT on Buffalo WHR-HP-GN model, maybe because the file is different:root@Oficina-Buffalo:~# more /tmp/dnsmasq.leases86400 00:12:3f:cf:e0:b7 192.168.8.135 SuperJ-PC 01:00:12:3f:cf:e0:b70 00:1d:73:55:7c:9a 192.168.8.209 AP-9 01:00:1d:73:55:7c:9a0 00:1d:73:55:7b:bc 192.168.8.208 AP-8 01:00:1d:73:55:7b:bc0 00:1d:73:55:84:44 192.168.8.207 AP-7 01:00:1d:73:55:84:440 00:1d:73:55:f7:26 192.168.8.206 AP-6 01:00:1d:73:55:f7:260 00:1d:73:55:7e:aa 192.168.8.205 AP-5 01:00:1d:73:55:7e:aa0 00:1d:73:de:03:d8 192.168.8.203 AP-3 01:00:1d:73:de:03:d80 00:1d:73:55:f8:7e 192.168.8.202 AP-2 01:00:1d:73:55:f8:7e0 00:1d:73:55:f7:bc 192.168.8.201 AP-1 01:00:1d:73:55:f7:bc0 00:1d:73:55:f8:00 192.168.8.204 AP-4 01:00:1d:73:55:f8:000 00:1d:1a:07:c6:a5 192.168.8.212 Router-OvisLink-Hall 01:00:1d:1a:07:c6:a50 00:1e:2a:dc:6b:15 192.168.8.228 APWiFi-NetGear-Hall 01:00:1e:2a:dc:6b:1586400 00:1f:fe:60:86:40 192.168.8.147 * *Both routers seem to use udhcpd.All I need is to just obtain the number of DHCP Leases at /tmp/udhcpd.leases, but these strange characters don't allow me to count the number of lines:~ # cat /tmp/udhcpd.leases | wc -l0How could I clean this strange file, or at least count the number of lines (that will correspond to the number of DHCP leases)?As usual on routers (DD-WRT for this case), the included Linux is just an embedded version, so installation of extra packages would rather be difficult.
Listing a file with strange characters on DD-WRT embedded Linux
embedded;special characters