Ubiquiti UniFi Command-Line Interface Reference
Please share with your friends...
  • 2
  • 1
  •  
  •  
  • 1
  • 1
  •  
  •  
  •  
  •  
    5
    Shares


⇐ BackPageNext ⇒
Commands

P

ABCDEFGHIJKLMNOPQRSTUVWXYZ


passwd

Change USER’s password. If no USER is specified, changes the password for the current user.

passwd [OPTIONS] [USER]

Options:
        -a      Algorithm to use for password (choices: des, md5)
        -d      Delete password for the account
        -l      Lock (disable) account
        -u      Unlock (re-enable) account


pgrep

Display process(es) selected by regex PATTERN.

pgrep [-flnovx] [-s SID|-P PPID|PATTERN]

Options:
        -l      Show command name too
        -f      Match against entire command line
        -n      Show the newest process only
        -o      Show the oldest process only
        -v      Negate the match
        -x      Match whole name (not substring)
        -s      Match session ID (0 for current)
        -P      Match parent process ID


pidof

List PIDs of all processes with names that match NAMEs.

pidof [OPTIONS] [NAME...]

Options:
        -s      Show only one PID
        -o PID  Omit given pid
                Use %PPID to omit pid of pidof's parent


ping

Send ICMP ECHO_REQUEST packets to network hosts.

ping [OPTION]... host

Options:
        -4, -6          Force IPv4 or IPv6 hostname resolution
        -c CNT          Send only CNT pings
        -s SIZE         Send SIZE data bytes in packets (default:56)
        -I IFACE/IP     Use interface or IP address as source
        -W SEC          Seconds to wait for the first response (default:10)
                        (after all -c CNT packets are sent)
        -w SEC          Seconds until ping exits (default:infinite)
                        (can exit earlier with -c CNT)
        -q              Quiet, only displays output at start
                        and when finished
Example

The following example shows how to ping a network host.

# ping -c 4 ubnt.com
PING ubnt.com (54.215.188.14): 56 data bytes
64 bytes from 54.215.188.14: seq=0 ttl=55 time=163.358 ms
64 bytes from 54.215.188.14: seq=1 ttl=54 time=159.129 ms
64 bytes from 54.215.188.14: seq=2 ttl=55 time=186.654 ms
64 bytes from 54.215.188.14: seq=3 ttl=55 time=182.597 ms

--- ubnt.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 159.129/172.934/186.654 ms
[_/su_spoiler]


ping6

Send ICMP ECHO_REQUEST packets to network hosts.

ping6 [OPTIONS] HOST

Options:
        -c CNT          Send only CNT pings
        -s SIZE         Send SIZE data bytes in packets (default:56)
        -I IFACE/IP     Use interface or IP address as source
        -q              Quiet, only displays output at start
                        and when finished


pivot_root

Move the current root file system to PUT_OLD and make NEW_ROOT the new root file system.

pivot_root NEW_ROOT PUT_OLD


pkill

Send a signal to process(es) selected by regex PATTERN.

pkill [-l|-SIGNAL] [-fnovx] [-s SID|-P PPID|PATTERN]

Options:
        -l      List all signals
        -f      Match against entire command line
        -n      Signal the newest process only
        -o      Signal the oldest process only
        -v      Negate the match
        -x      Match whole name (not substring)
        -s      Match session ID (0 for current)
        -P      Match parent process ID


pktgen.sh
pktgen.sh -i <if_name> -d <dst_ip> -m <dst_mac> -s <pkt_size> -c <pkt_count|0>


pm
    pm app-list
    pm app-resource-list
    pm app-create <name> <path>
    pm app-delete <name>
    pm app-start {<id> | <name>}
    pm app-stop {<id> | <name>}
    pm app-restart {<id> | <name>}
    pm app-reboot {<id> | <name>}
    pm app-no-reboot {<id> | <name>}
    pm app-auto-restart {<id> | <name>}
    pm app-no-auto-restart {<id> | <name>}
    pm app-max-mem {<id> | <name>} <MB>
    pm app-cpu-share {<id> | <name>} <percent-cpu>
    pm sys-restart
    pm proc-list
    pm proc-hang-detect
    pm proc-no-hang-detect


poweroff

Halt and shut off power.

poweroff [-d SEC] [-n] [-f]

Options:
        -d SEC  Delay interval in seconds before powering off
        -n      No call to sync()
        -f      Force reboot (don't go through init)
Issuing a poweroff command without arguments or parameters will cause an immediate poweroff!
As UniFi devices do not have the ability to power off, this command is effectively the same as the halt command.


printf

Format and print ARGUMENT(s) according to FORMAT, where FORMAT controls the output exactly as in C printf.

printf FORMAT [ARGUMENT...]


ps

Report process status.

ps

Options:
        -o col1,col2=header     Select columns for display
        -T                      Show threads
Example: UniFi AP AC (UAP-ACv2)

The following example shows how to report process status.

# ps
 PID USER       VSZ STAT COMMAND
    1 ubnt      1356 S    init
    2 ubnt         0 SW<  [kthreadd]
    3 ubnt         0 SW<  [ksoftirqd/0]
    4 ubnt         0 SW<  [events/0]
    5 ubnt         0 SW<  [khelper]
   15 ubnt         0 SW<  [kblockd/0]
   46 ubnt         0 SW   [pdflush]
   47 ubnt         0 SW   [pdflush]
   48 ubnt         0 SW<  [kswapd0]
   49 ubnt         0 SW<  [aio/0]
   70 ubnt         0 SW<  [mtdblockd]
  246 ubnt       564 S    /sbin/hotplug2 --persistent --set-rules-file /usr/etc
  533 ubnt      1356 S    init
  534 ubnt      1348 S    /usr/bin/klogd -c 8 -n
  535 ubnt      3572 S    /bin/reset-handler
  544 ubnt      3720 S    /bin/mcad
  546 ubnt      3576 S    /bin/mca-monitor
  900 ubnt      1356 S    /usr/bin/crond -c /etc/crontabs -l 5
 1058 ubnt      1372 S    /sbin/udhcpc -f -i br0 -V ubnt -A 10 -s /etc/udhcpc/u
 1063 ubnt       980 S    /bin/dropbear -F -d /var/run/dropbear_dss_host_key -r
 1067 ubnt      1172 S    /bin/stamgr -i 1
 1071 ubnt      1352 S    /bin/syslogd -n -O /var/log/messages -l 7 -s 200 -b 0
 1072 ubnt      2360 S    /bin/hostapd /etc/aaa1.cfg
 1102 ubnt       628 S    /sbin/ntpclient -i 86400 -n -s -c 0 -l -h 0.ubnt.pool
 1188 ubnt      1072 R    /bin/dropbear -F -d /var/run/dropbear_dss_host_key -r
 1189 ubnt      1396 R    -sh
 1197 ubnt      1352 R    ps
[_/su_spoiler]
Example: UniFi Switch 48 750W (USW-48P-750)

The following example shows how to report process status.

# ps
  PID USER       VSZ STAT COMMAND
    1 ubnt      1320 S    init
    2 ubnt         0 SW   [kthreadd]
    3 ubnt         0 SW   [ksoftirqd/0]
    4 ubnt         0 SW   [kworker/0:0]
    5 ubnt         0 SW<  [kworker/0:0H]
    6 ubnt         0 SW   [kworker/u:0]
    7 ubnt         0 SW<  [kworker/u:0H]
    8 ubnt         0 SW   [migration/0]
    9 ubnt         0 SW<  [khelper]
   10 ubnt         0 SW   [kdevtmpfs]
   11 ubnt         0 SW   [kworker/u:1]
   77 ubnt         0 SW   [bdi-default]
   79 ubnt         0 SW<  [kblockd]
  100 ubnt         0 RW   [kworker/0:1]
  113 ubnt         0 SW   [kswapd0]
  156 ubnt         0 SW   [fsnotify_mark]
  279 ubnt         0 SW   [spi1]
  283 ubnt         0 SW   [mtdblock0]
  288 ubnt         0 SW   [mtdblock1]
  293 ubnt         0 SW   [mtdblock2]
  298 ubnt         0 SW   [mtdblock3]
  303 ubnt         0 SW   [mtdblock4]
  308 ubnt         0 SW   [mtdblock5]
  313 ubnt         0 SW   [mtdblock6]
  320 ubnt         0 SW<  [deferwq]
  385 ubnt       612 S    /sbin/hotplug2 --persistent --set-rules-file /usr/etc/hotplug2.rules
  717 ubnt       924 S    /bin/procmgr
  740 ubnt     86124 S    switchdrvr boot
  741 ubnt      2668 S    syncdb
  875 ubnt      1320 S    init
  876 ubnt      1304 S    /usr/bin/klogd -c 8 -n
  877 ubnt      4960 S    /bin/reset-handler
  878 ubnt      1304 S    /bin/syslogd -n -O /var/log/messages -l 7 -s 200 -b 0
  879 ubnt      5092 S    /bin/uplink-monitor
  880 ubnt      1320 S    /sbin/udhcpc -f -i eth0 -V ubnt -A 10 -s /etc/udhcpc/udhcpc -p /var/run/udhcpc.eth0.pid
  882 ubnt      1060 S    /bin/dropbear -F -d /var/run/dropbear_dss_host_key -r /var/run/dropbear_rsa_host_key -p 22
  883 ubnt      5004 S    /bin/mcad
  884 ubnt      4964 S    /bin/mca-monitor
 1341 ubnt       808 S    /sbin/ntpclient -i 86400 -n -s -c 0 -l -h 0.ubnt.pool.ntp.org
 2969 ubnt      1152 R    /bin/dropbear -F -d /var/run/dropbear_dss_host_key -r /var/run/dropbear_rsa_host_key -p 22
 2970 ubnt      1412 S    -sh
 2988 ubnt      1308 R    ps
[_/su_spoiler]


psta.sh
This shell script is only available on UniFi AP devices.
psta.sh


pstree

Display process tree, optionally start from USER or PID.

pstree [-p] [PID|USER]

        -p      Show pids<pre>


pwd

Print the full filename of the current working directory.

pwd
Example

The following example shows how to print the working directory.

# ps
/var/etc/persistent
[_/su_spoiler]


pwdog

Send icmp packets to check network host online.

pwdog [OPTION]... host

options:
        -v              enables verbose prints to console.
        -d delay
initial sleep time (in seconds).
        -c retry        retry pings before executing failure command.
        -p period       time period between consequent pings.
        -e command      command to execute on failure.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
⇐ BackPageNext ⇒

Ubiquiti UniFi Command-Line Interface Reference

Please share with your friends...
  • 2
  • 1
  •  
  •  
  • 1
  • 1
  •  
  •  
  •  
  •  
    5
    Shares
Tagged on:                     

Leave a Reply