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


⇐ BackPageNext ⇒
Commands

S

ABCDEFGHIJKLMNOPQRSTUVWXYZ


sadf

Display data collected by sar in multiple formats.

sadf [ options... ] [ <interval> [ <count> ] ] [ <datafile> ]

Options are:
[ -d | -D | -H | -p | -x ] [ -t ] [ -V ]
[ -P { <cpu> | ALL } ] [ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]
[ -- <sar_options...> ]
UNBTSee Alsosar


sar

Collect, report, or save system activity information.

sar [ options... ] [ <interval> [ <count> ] ]

Options are:
[ -A ] [ -b ] [ -B ] [ -c ] [ -C ] [ -d ] [ -i <interval> ] [ -p ] [ -q ]
[ -r ] [ -R ] [ -t ] [ -u ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ]
[ -I { <irq> | SUM | ALL | XALL } ] [ -P { <cpu> | ALL } ]
[ -n { DEV | EDEV | NFS | NFSD | SOCK | ALL } ]
[ -o [ <filename> ] | -f [ <filename> ] ]
[ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]
UNBTSee Alsosadf


scp

secure copy (remote file copy program).

scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
    [-l limit] [-o ssh_option] [-P port] [-S program]
    [[user@]host1:]file1 [...] [[user@]host2:]file2
UNBTSee Alsocp


sed

Stream EDitor for filtering and transforming text.

sed [-efinr] pattern [files...]

Options:
        -e script       Add the script to the commands to be executed
        -f scriptfile   Add scriptfile contents to the
                        commands to be executed
        -i              Edit files in-place
        -n              Suppress automatic printing of pattern space
        -r              Use extended regular expression syntax
If no -e or -f is given, the first non-option argument is taken as the sed script to interpret. All remaining arguments are names of input files; if no input files are specified, then the standard input is read. Source files will not be modified unless -i option is given.


seq

Print numbers from FIRST to LAST, in steps of INC. FIRST, INC default to 1.

seq [-w] [-s SEP] [FIRST [INC]] LAST

Options:
        -w      Pad to last with leading zeros
        -s SEP  String separator
Example

The following example shows how to print a sequence of number from 1 to 5.

# seq 1 5
1
2
3
4
5
[_/su_spoiler]


set-default

Restore to factory defaults.

set-default
Example: UniFi AP AC (UAP-ACv2)

The following example shows how to restore factory defaults.

# set-default
Found Active on[1] ...
Found Backup1 on[2] ...
Storing Active[2] ... [%100]
Active->Backup[1] ... [%100]
[_/su_spoiler]
Issuing the set-default command will cause the device to immediately restore factory defaults without further confirmation, and then reboot.


set-inform

Attempt inform URL.

set-inform <inform_host>
Example

The following example shows how to attempt an inform using a fixed IP address.

# set-inform http://192.168.0.8:8080/inform
Adoption request sent to 'http://192.168.0.8:8080/inform'.

1. please adopt it on the controller
2. issue the set-inform command again
3. <inform_url> will be saved after device is successfully managed
[_/su_spoiler]
The default inform URL is http://unifi:8080/inform


sh

Built-in shell (ash).

sh

Built-in commands:
-------------------
        . : [ [[ alias bg break cd chdir command continue echo eval exec
        exit export false fg getopts hash help jobs kill let local printf
        pwd read readonly return set shift source test times trap true
        type ulimit umask unalias unset wait


show_node
show_node <radio> <mac_addr>


show_nt
show_nt


sleep

Pause for a time equal to the total of the args given, where each arg can have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays.

sleep [N]...


sort

Sort lines of text.

sort [-nrugMcszbdfimSTokt] [-o FILE] [-k start[.offset][opts][,end[.offset][opts]] [-t CHAR] [FILE]...

Options:
        -b      Ignore leading blanks
        -c      Check whether input is sorted
        -d      Dictionary order (blank or alphanumeric only)
        -f      Ignore case
        -g      General numerical sort
        -i      Ignore unprintable characters
        -k      Sort key
        -M      Sort month
        -n      Sort numbers
        -o      Output to file
        -k      Sort by key
        -t CHAR Key separator
        -r      Reverse sort order
        -s      Stable (don't sort ties alphabetically)
        -u      Suppress duplicate lines
        -z      Lines are terminated by NUL, not newline
        -mST    Ignored for GNU compatibility


ssh

Dropbear SSH client.

ssh [options] [user@]host[/port] [command]

     -p <remoteport>
     -l <username>
     -t    Allocate a pty
     -T    Don't allocate a pty
     -N    Don't run a remote command
     -f    Run in background after auth
     -y    Always accept remote host key if unknown
     -y -y Don't perform any remote host key checking (caution)
     -s    Request a subsystem (use by external sftp)
     -i <identityfile> (multiple allowed)
     -A    Enable agent auth forwarding
     -L <[listenaddress:]listenport:remotehost:remoteport> Local port forwarding
     -g    Allow remote hosts to connect to forwarded ports
     -R <[listenaddress:]listenport:remotehost:remoteport> Remote port forwarding
     -W <receive_window_buffer> (default 24576, larger may be faster, max 1MB)
     -K <keepalive> (0 is never, default 0)
     -I <idle_timeout> (0 is never, default 0)
     -J <proxy_program> Use program pipe rather than TCP connection
     -c <cipher list> Specify preferred ciphers ('-c help' to list options)
     -m <MAC list> Specify preferred MACs for packet verification (or '-m help')
This command is the same as the dbclient command (symlink).


stack-trace
stack-trace <pid>


stainfo
This command is only available on UniFi AP devices.

Display continuous information about connected WiFi stations.

stainfo [options]

        -a          show all stations (not just the active ones)
        -i          interval (default is 1)
        -b          radio (ng | na)
        -r          kick sta when rssi is lower than specified
        -n          kick sta when total connected sta exceed maxsta limit
        -h          help

                       +- radio: b/[n]g/[n]a/ac
                       | +- t(tkip) e(aes or wep)
                       | |                                               accumulated >------<
48m[28:37:37:1e:88:e2] npe idle=  0 rssi=60   6/130 ccq=  18 tx/ret=  0/ 0 rx=  7 err=2281/0
                      | |                                   >--------delta-------<
                      | +- p(powersave) u(uspad)
                      +- !(not authorized) ?(dhcp unseen) 1(dhcp discover) 3(dhcp request) ' '(dhcp done/ack)
Example: UniFi AP AC (UAP-ACv2)
The following example shows five seconds of output.

# stainfo
 7m[48:5a:3f:71:00:00] ac. idle= 0 rssi=49 866/ 6 tx/ret=98178/ 0 rx/ret/mc=68384/ 0/ 0 err= 410/0
 wifi0[ng]: txto/txserr/rst/bcn=0/0/0 be=0/0 mgmt=0 multi=0 rx=0 nobuf=0 rxovfl=0
 wifi1[na]: txto/txserr/rst/bcn=416/0/3 be=4793/1189 mgmt=105 multi=789 rx=1084 nobuf=66772 rxovfl=0
 7m[48:5a:3f:71:00:00] ac. idle= 0 rssi=49 866/ 24 tx/ret=8515/ 0 rx/ret/mc=4261/ 0/ 0 err= 410/0
 wifi0[ng]: txto/txserr/rst/bcn=0/0/0 be=0/0 mgmt=0 multi=0 rx=0 nobuf=0 rxovfl=0
 wifi1[na]: txto/txserr/rst/bcn=0/0/0 be=10/2 mgmt=0 multi=0 rx=2 nobuf=4235 rxovfl=0
 7m[48:5a:3f:71:00:00] ac. idle= 0 rssi=47 866/ 6 tx/ret=8566/ 0 rx/ret/mc=4667/ 0/ 0 err= 410/0
 wifi0[ng]: txto/txserr/rst/bcn=0/0/0 be=0/0 mgmt=0 multi=0 rx=0 nobuf=0 rxovfl=0
 wifi1[na]: txto/txserr/rst/bcn=0/0/0 be=9/5 mgmt=0 multi=0 rx=5 nobuf=4670 rxovfl=0
 7m[48:5a:3f:71:00:00] ac. idle= 0 rssi=47 866/866 tx/ret=8528/ 0 rx/ret/mc=4474/ 0/ 0 err= 410/0
 wifi0[ng]: txto/txserr/rst/bcn=0/0/0 be=0/0 mgmt=0 multi=0 rx=0 nobuf=0 rxovfl=0
 wifi1[na]: txto/txserr/rst/bcn=0/0/0 be=10/12 mgmt=0 multi=0 rx=12 nobuf=4455 rxovfl=0
 7m[48:5a:3f:71:00:00] acp idle= 0 rssi=50 866/ 24 tx/ret=6010/ 0 rx/ret/mc=3014/ 0/ 0 err= 410/0
 wifi0[ng]: txto/txserr/rst/bcn=0/0/0 be=0/0 mgmt=0 multi=0 rx=0 nobuf=0 rxovfl=0
 wifi1[na]: txto/txserr/rst/bcn=0/0/0 be=10/1 mgmt=0 multi=19 rx=1 nobuf=2986 rxovfl=0
[_/su_spoiler]
UNBTSee Alsostamgr


stamgr
This command is only available on UniFi AP devices.

Display continuous information about connected WiFi stations; it is exactly the same command as the stainfo command.


start-stop-daemon

Search for matching processes, and then -K: stop all matching processes. -S: start a process unless a matching process is found.

start-stop-daemon [OPTIONS] [-S|-K] ... [-- arguments...]

Process matching:
        -u,--user USERNAME|UID  Match only this user's processes
        -n,--name NAME          Match processes with NAME
                                in comm field in /proc/PID/stat
        -x,--exec EXECUTABLE    Match processes with this command
                                in /proc/PID/cmdline
        -p,--pidfile FILE       Match a process with PID from the file
        All specified conditions must match
-S only:
        -x,--exec EXECUTABLE    Program to run
        -a,--startas NAME       Zeroth argument
        -b,--background         Background
        -N,--nicelevel N        Change nice level
        -c,--chuid USER[:[GRP]] Change to user/group
        -m,--make-pidfile       Write PID to the pidfile specified by -p
-K only:
        -s,--signal SIG         Signal to send
        -t,--test               Match only, exit with 0 if a process is found
Other:
        -o,--oknodo             Exit with status 0 if nothing is done
        -v,--verbose            Verbose
        -q,--quiet              Quiet


strings

Display printable strings in a binary file.

strings [-afo] [-n LEN] [FILE]...

Options:
        -a      Scan whole file (default)
        -f      Precede strings with filenames
        -n LEN  At least LEN characters form a string (default 4)
        -o      Precede strings with decimal offsets


stty

Without arguments, prints baud rate, line discipline, and deviations from stty sane.

stty [-a|g] [-F DEVICE] [SETTING]...

Options:
        -F DEVICE       Open device instead of stdin
        -a              Print all current settings in human-readable form
        -g              Print in stty-readable form
        [SETTING]       See manpage


support
support


swapoff

Stop swapping on DEVICE.

swapoff [-a] [DEVICE]

Options:
        -a      Stop swapping on all swap devices


swapon

Start swapping on DEVICE.

swapon [-a] [-p pri] [DEVICE]

Options:
        -a      Start swapping on all swap devices
        -p pri  Set swap device priority


swctrl
This command is only available on UniFi Switch devices.

UniFi Switch control utility.

swctrl [options]

        -d <port|mac|poe>       show <port|mac|poe> table

        -p port=                show port 
        -p port=,poe            show poe stats of port 

        -b show                 show blocked station(s)
        -b mac=                 block station
        -b remove,mac=          unblock station
        -b file=                block station(s) listed in filename
        -b reset                clear all blocked station(s)

        -v                      verbose
        -h                      print this usage info
Examples: UniFi Switch 48 750W (USW-48P-750)

The following example shows the Ethernet status of a specified port.

# swctrl -p port=5
Port  Link Rate    Receive   Transmit    Receive   Transmit  state    STP
----- ---- ----- ---------- ---------- ---------- ---------- ----- ----------
   5  U/U  1000F       4893      29686    1811881    4669732       forwarding

The following example shows the PoE status of a specified port.

# swctrl -p port=5,poe
Port  OpMode  Class    PoEPwr  PwrGood   Voltage(V)  Current(mA)
----  ------  -------  ------  -------  -----------  -----------
   5    Auto  Class 4      On     Good        51.92       128.17
[_/su_spoiler]


switch_root

Free initramfs and switch to another root fs: chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.

switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGS]

Options:
        -c DEV  Reopen stdio to DEV after switch


switchdrvr
This command is only available on UniFi Switch devices.
switchdrvr
Examples: UniFi Switch 48 750W (USW-48P-750)
The following example shows what occurs when this command is invoked.

# switchdrvr
Restoring EEPROM data from ubnthal
MAC: 04:18:d6:83:10:00
Validating the active image /dev/mtd3..."3.3.5.3734"
Validating the backup image /dev/mtd4..."3.3.4.3731"
DMA pool size: 4194304
AXI unit 0: Dev 0x8344, Rev 0x01, Chip BCM53344_A0, Driver BCM56150_A0
PCI unit 1: Dev 0x8346, Rev 0x01, Chip BCM53346_A0, Driver BCM56150_A0
SOC unit 0 attached to PCI device BCM53344_A0
[_/su_spoiler]
Issuing this command will cause the device to immediately shutdown and reboot without further confirmation!


sync

Write all buffered blocks to disk.

sync


syncdb
This command is only available on UniFi Switch devices.
syncdb


syncdb_test
This command is only available on UniFi Switch devices.
syncdb_test
UNBTSee Alsosyncdb


sysctl

Configure kernel parameters at runtime.

sysctl [OPTIONS] [VALUE]...

Options:
        -n      Don't print key names
        -e      Don't warn about unknown keys
        -w      Change sysctl setting
        -p FILE Load sysctl settings from FILE (default /etc/sysctl.conf)
        -a      Display all values
        -A      Display all values in table form


syslogd

System logging utility.

syslogd [OPTIONS]

Options:
        -n              Run in foreground
        -O FILE         Log to given file (default:/var/log/messages)
        -l n            Set local log level
        -S              Smaller logging output
        -s SIZE         Max size (KB) before rotate (default:200KB, 0=off)
        -b NUM          Number of rotated logs to keep (default:1, max=99, 0=purge)
        -R HOST[:PORT]  Log to IP or hostname on PORT (default PORT=514/UDP)
        -L              Log locally and via network (default is network only if -R)
        -D              Drop duplicates
        -C[size(KiB)]   Log to shared mem buffer (read it using logread)
This version of syslogd ignores /etc/syslog.conf.


syswrapper.sh
syswrapper.sh
ABCDEFGHIJKLMNOPQRSTUVWXYZ
⇐ BackPageNext ⇒

Ubiquiti UniFi Command-Line Interface Reference

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

Leave a Reply