Moler ships with more than 100 ready-made Unix command parsers. Every command class accepts aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nokia/moler/llms.txt
Use this file to discover all available pages before exploring further.
connection object, sends the underlying shell command, and returns a structured result dictionary when parsing is complete.
All Unix command classes inherit from
GenericUnixCommand (module moler.cmd.unix.genericunix). The base class handles prompt detection and newline splitting; concrete classes implement build_command_string() and on_new_line() parsing.Full command list
| Class | Module | Shell command |
|---|---|---|
AdbDevices | moler.cmd.unix.adb_devices | adb devices |
AdbForward | moler.cmd.unix.adb_forward | adb forward |
AdbRoot | moler.cmd.unix.adb_root | adb root |
Bash | moler.cmd.unix.bash | bash |
Bzip2 | moler.cmd.unix.bzip2 | bzip2 |
Cat | moler.cmd.unix.cat | cat |
Cd | moler.cmd.unix.cd | cd |
Chgrp | moler.cmd.unix.chgrp | chgrp |
Chmod | moler.cmd.unix.chmod | chmod |
Chown | moler.cmd.unix.chown | chown |
Cp | moler.cmd.unix.cp | cp |
CtrlC | moler.cmd.unix.ctrl_c | ^C |
CtrlZ | moler.cmd.unix.ctrl_z | ^Z |
Cut | moler.cmd.unix.cut | cut |
Date | moler.cmd.unix.date | date |
Devmem | moler.cmd.unix.devmem | devmem |
Df | moler.cmd.unix.df | df |
Dmesg | moler.cmd.unix.dmesg | dmesg |
Du | moler.cmd.unix.du | du |
Echo | moler.cmd.unix.echo | echo |
Enter | moler.cmd.unix.enter | (newline) |
Env | moler.cmd.unix.env | env |
Ethtool | moler.cmd.unix.ethtool | ethtool |
Exit | moler.cmd.unix.exit | exit |
ExitTelnet | moler.cmd.unix.exit_telnet | exit (telnet) |
Export | moler.cmd.unix.export | export |
Find | moler.cmd.unix.find | find |
Grep | moler.cmd.unix.grep | grep |
Gunzip | moler.cmd.unix.gunzip | gunzip |
Gzip | moler.cmd.unix.gzip | gzip |
Hciconfig | moler.cmd.unix.hciconfig | hciconfig |
Head | moler.cmd.unix.head | head |
Hexdump | moler.cmd.unix.hexdump | hexdump |
History | moler.cmd.unix.history | history |
Hostname | moler.cmd.unix.hostname | hostname |
Hostnamectl | moler.cmd.unix.hostnamectl | hostnamectl |
Id | moler.cmd.unix.id | id |
Ifconfig | moler.cmd.unix.ifconfig | ifconfig |
IpAddr | moler.cmd.unix.ip_addr | ip addr |
IpLink | moler.cmd.unix.ip_link | ip link |
IpMaddr | moler.cmd.unix.ip_maddr | ip maddr |
IpNeigh | moler.cmd.unix.ip_neigh | ip neigh |
IpRoute | moler.cmd.unix.ip_route | ip route |
Iperf | moler.cmd.unix.iperf | iperf |
Iperf2 | moler.cmd.unix.iperf2 | iperf |
Iperf3 | moler.cmd.unix.iperf3 | iperf3 |
Ipsec | moler.cmd.unix.ipsec | ipsec |
Iptables | moler.cmd.unix.iptables | iptables |
Kill | moler.cmd.unix.kill | kill |
Killall | moler.cmd.unix.killall | killall |
Ln | moler.cmd.unix.ln | ln |
Logout | moler.cmd.unix.logout | logout |
Ls | moler.cmd.unix.ls | ls |
Lsof | moler.cmd.unix.lsof | lsof |
LxcAttach | moler.cmd.unix.lxc_attach | lxc-attach |
LxcInfo | moler.cmd.unix.lxc_info | lxc-info |
LxcLs | moler.cmd.unix.lxc_ls | lxc-ls |
Md5sum | moler.cmd.unix.md5sum | md5sum |
Mkdir | moler.cmd.unix.mkdir | mkdir |
Mount | moler.cmd.unix.mount | mount |
Mpstat | moler.cmd.unix.mpstat | mpstat |
Mv | moler.cmd.unix.mv | mv |
Netstat | moler.cmd.unix.netstat | netstat |
Nft | moler.cmd.unix.nft | nft |
Nmap | moler.cmd.unix.nmap | nmap |
Nping | moler.cmd.unix.nping | nping |
Ntpq | moler.cmd.unix.ntpq | ntpq |
OpensslSClient | moler.cmd.unix.openssl_s_client | openssl s_client |
OpensslX509TextIn | moler.cmd.unix.openssl_x509_text_in | openssl x509 |
Passwd | moler.cmd.unix.passwd | passwd |
Ping | moler.cmd.unix.ping | ping / ping6 |
Pkill | moler.cmd.unix.pkill | pkill |
Ps | moler.cmd.unix.ps | ps |
Pwd | moler.cmd.unix.pwd | pwd |
Reboot | moler.cmd.unix.reboot | reboot |
Rm | moler.cmd.unix.rm | rm |
Route | moler.cmd.unix.route | route |
RunScript | moler.cmd.unix.run_script | (script) |
RunSerialProxy | moler.cmd.unix.run_serial_proxy | (proxy) |
Scp | moler.cmd.unix.scp | scp |
Sed | moler.cmd.unix.sed | sed |
Service | moler.cmd.unix.service | service |
SevenZ | moler.cmd.unix.seven_z | 7z |
Sftp | moler.cmd.unix.sftp | sftp |
Shasum | moler.cmd.unix.shasum | shasum |
Socat | moler.cmd.unix.socat | socat |
Ss | moler.cmd.unix.ss | ss |
Ssh | moler.cmd.unix.ssh | ssh |
Sshkeygen | moler.cmd.unix.sshkeygen | ssh-keygen |
Su | moler.cmd.unix.su | su |
Sudo | moler.cmd.unix.sudo | sudo |
Sync | moler.cmd.unix.sync | sync |
Sysctl | moler.cmd.unix.sysctl | sysctl |
Systemctl | moler.cmd.unix.systemctl | systemctl |
Tail | moler.cmd.unix.tail | tail |
TailLatestFile | moler.cmd.unix.tail_latest_file | tail (latest) |
Tar | moler.cmd.unix.tar | tar |
Tcpdump | moler.cmd.unix.tcpdump | tcpdump |
Tee | moler.cmd.unix.tee | tee |
Telnet | moler.cmd.unix.telnet | telnet |
Top | moler.cmd.unix.top | top |
Touch | moler.cmd.unix.touch | touch |
Traceroute | moler.cmd.unix.traceroute | traceroute |
Tshark | moler.cmd.unix.tshark | tshark |
Uname | moler.cmd.unix.uname | uname |
Unrar | moler.cmd.unix.unrar | unrar |
Unxz | moler.cmd.unix.unxz | unxz |
Unzip | moler.cmd.unix.unzip | unzip |
Uptime | moler.cmd.unix.uptime | uptime |
Useradd | moler.cmd.unix.useradd | useradd |
Userdel | moler.cmd.unix.userdel | userdel |
W | moler.cmd.unix.w | w |
Wget | moler.cmd.unix.wget | wget |
Which | moler.cmd.unix.which | which |
Whoami | moler.cmd.unix.whoami | whoami |
Zip | moler.cmd.unix.zip | zip |
Detailed reference by category
Network
Network
Ping — moler.cmd.unix.ping
Sends ICMP echo requests. Automatically uses ping6 when the destination contains : (IPv6 address).Moler connection to the device.
IPv4 or IPv6 address / hostname to ping.
Additional CLI options, e.g.
"-c 5" or "-w 10".Regex for the shell prompt. Defaults to generic prompt detection.
Characters used to split output lines.
Runner used to execute the command.
| Key | Type | Description |
|---|---|---|
packets_transmitted | int | Total packets sent |
packets_received | int | Total packets received |
packet_loss | float | Packet loss percentage |
time | int | Total ping duration (in packets_time_unit) |
time_seconds | float | Total ping duration in seconds |
packets_time_unit | str | Time unit for total time, e.g. "ms" |
time_min | float | Minimum RTT |
time_avg | float | Average RTT |
time_max | float | Maximum RTT |
time_mdev | float | RTT standard deviation |
time_min_seconds | float | Minimum RTT in seconds |
time_avg_seconds | float | Average RTT in seconds |
time_max_seconds | float | Maximum RTT in seconds |
time_mdev_seconds | float | RTT standard deviation in seconds |
time_unit | str | RTT time unit, e.g. "ms" |
errors | int | Error count (only present when errors reported) |
duplicates | int | Duplicate count (only present when duplicates reported) |
Ifconfig — moler.cmd.unix.ifconfig
Retrieves network interface configuration. Keyed by interface name.Moler connection to the device.
Options passed directly to
ifconfig, e.g. "eth0" to restrict to one interface."eth0", "br0"). Each interface dict contains:| Key | Type | Description |
|---|---|---|
IPV4 | list[dict] | IPv4 addresses with IP, BRD, MASK |
IPV6 | list[dict] | IPv6 addresses with IP, MASK, SCOPE |
LINK | list[dict] | Link layer info with ENCAP, MAC |
CONTENT | list[str] | Raw content lines |
RX | dict | RX packet/byte counters |
TX | dict | TX packet/byte counters |
IpRoute — moler.cmd.unix.ip_route
Runs ip route (or ip -6 route) and parses the routing table.Moler connection to the device.
Set
True to run ip -6 route. Default False.Address for
ip route get <addr>.Source address filter with
from keyword.| Key | Type | Description |
|---|---|---|
VIA | dict | Default gateway information |
ALL | list | All route entries |
ADDRESS | dict | Per-prefix route details |
Ssh — moler.cmd.unix.ssh
Establishes an SSH connection. Handles host-key prompts, password prompts, known-hosts failures, and terminal resize sequences automatically.Moler connection to the device.
Remote hostname or IP address.
SSH username (passed via
-l).Password or list of passwords for multi-step authentication.
Remote port. Default
0 (SSH default port 22).Regex for the prompt on the remote host. Default
">".How to handle unknown host:
"keygen" (run ssh-keygen -R) or "rm". Default "keygen".Extra SSH options injected before the hostname. Default
-o ServerAliveInterval=7 -o ServerAliveCountMax=2.Replace password characters with
* in logs. Default True.Netstat — moler.cmd.unix.netstat
Runs netstat and parses socket/connection listings.Traceroute — moler.cmd.unix.traceroute
Runs traceroute and parses hop-by-hop routing output.Nmap — moler.cmd.unix.nmap
Runs nmap network scanner and parses open port results.Wget — moler.cmd.unix.wget
Downloads URLs via wget. Reports download completion records and optionally logs progress.Moler connection to the device.
Options passed to
wget, typically including the URL.Set
True to collect progress bar lines into PROGRESS_LOG. Default False.| Key | Type | Description |
|---|---|---|
RESULT | list[str] | Completion lines: "YYYY-MM-DD HH:MM:SS (X.X MB/s) - 'file' saved" |
PROGRESS_LOG | list[str] | Progress bar lines (only when log_progress_bar=True) |
Filesystem
Filesystem
Ls — moler.cmd.unix.ls
Runs ls and parses file/directory listings. Supports plain, long (-l), and human-readable (-lh) formats.Moler connection to the device.
Options passed to
ls, e.g. "-l", "-lh", "-la".Path to list. Omit to list the current directory.
| Key | Type | Description |
|---|---|---|
files | dict | Mapping from filename to file-info dict |
total | dict | {"raw": "8", "bytes": 8} — only present with -l flag |
files (long listing) contains:| Key | Type | Description |
|---|---|---|
name | str | Filename |
permissions | str | Permission string, e.g. "-rwxr-xr-x" |
hard_links_count | int | Number of hard links |
owner | str | File owner |
group | str | File group |
size_raw | str | Raw size string |
size_bytes | int | Size in bytes (human suffixes expanded) |
date | str | Modification date string |
link | str | Link target (only for symlinks) |
get_dirs(), get_files(), and get_links() helper methods filter results by type.Find — moler.cmd.unix.find
Runs find and parses path results.Moler connection to the device.
Full options string for
find, e.g. "/var/log -name '*.log' -mtime +7".Cat — moler.cmd.unix.cat
Runs cat and returns file contents as a list of lines.Result: {"LINES": ["line1", "line2", ...]}Tail — moler.cmd.unix.tail
Runs tail on a file. Inherits from Cat.Moler connection to the device.
Path to the file to tail.
Options, e.g.
"-n 20" or "-f" (follow mode).{"LINES": ["last line 1", "last line 2", ...]}Grep — moler.cmd.unix.grep
Runs grep and parses matched lines, optionally with file paths, line numbers, and byte offsets.Moler connection to the device.
Full grep options including pattern and filename, e.g.
"-n 'error' /var/log/syslog".{"LINES": [...]}Each item in LINES is a dict with a subset of:| Key | Description |
|---|---|
LINE | The matched line content |
PATH | File path (when grepping multiple files) |
NUMBER | Line number (with -n) |
BYTES | Byte offset (with -b) |
Cp / Mv / Rm / Mkdir / Touch
Standard filesystem manipulation commands. All accept connection, options, and runner.Tar / Gzip / Gunzip / Bzip2 / Zip / Unzip / Unrar / Unxz / SevenZ
Archive and compression commands.Mount — moler.cmd.unix.mount
Runs mount and parses mount point information.Df — moler.cmd.unix.df
Runs df and parses disk usage per filesystem.Du — moler.cmd.unix.du
Runs du and parses disk usage per directory.Process
Process
Ps — moler.cmd.unix.ps
Runs ps and parses the process list. Returns a list of dicts (one per process row). Column names are derived dynamically from the header line, so the result adapts to the options used.Moler connection to the device.
Options string, e.g.
"-ef" or "-o user,pid,vsz,cmd -e". Default "".ps output. Numeric fields are converted to int or float automatically.Kill / Killall / Pkill — signal sending
Send signals to processes by PID or name.Top — moler.cmd.unix.top
Runs top (typically in batch mode) and parses live process stats.System
System
Uname — moler.cmd.unix.uname
Runs uname and returns kernel/OS information.Hostname / Hostnamectl — moler.cmd.unix.hostname
Retrieves the system hostname.Uptime — moler.cmd.unix.uptime
Parses uptime output into load averages and system up-time duration.Date — moler.cmd.unix.date
Parses current system date and time.Dmesg — moler.cmd.unix.dmesg
Captures kernel ring buffer messages.Sysctl — moler.cmd.unix.sysctl
Reads or writes kernel parameters.Systemctl — moler.cmd.unix.systemctl
Manages systemd services.Service — moler.cmd.unix.service
Controls SysV init services.Reboot — moler.cmd.unix.reboot
Sends the reboot command.Env / Export — moler.cmd.unix.env
Reads and sets environment variables.Sync — moler.cmd.unix.sync
Flushes filesystem buffers.Security / Auth
Security / Auth
Su — moler.cmd.unix.su
Switches user identity, handles password prompts.Sudo — moler.cmd.unix.sudo
Runs a command with elevated privileges.Passwd — moler.cmd.unix.passwd
Changes a user’s password interactively.Useradd / Userdel — moler.cmd.unix.useradd
Adds and removes user accounts.Id — moler.cmd.unix.id
Prints the current user and group IDs.Whoami — moler.cmd.unix.whoami
Prints the effective username.Chmod / Chown / Chgrp
File permission and ownership management.Sshkeygen — moler.cmd.unix.sshkeygen
Runs ssh-keygen to manage SSH keys.Iptables / Nft — moler.cmd.unix.iptables
Network packet filtering rule management.Transfer
Transfer