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


⇐ BackPageNext ⇒
Commands

T

ABCDEFGHIJKLMNOPQRSTUVWXYZ


tail

Print last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name. With no FILE, or when FILE is -, read standard input.

tail [OPTIONS] [FILE]...

Options:
        -c N[kbm]       Output the last N bytes
        -n N[kbm]       Print last N lines instead of last 10
        -f              Output data as the file grows
        -q              Never output headers giving file names
        -s SEC          Wait SEC seconds between reads with -f
        -v              Always output headers giving file names
Example

The following example shows how to display the last 10 lines from standard input.

# dmesg | tail
[   14.240000] creating /proc/gpio/
[   14.240000]          /proc/gpio/led_pattern
[   14.240000]          /proc/gpio/led_tempo
[   14.240000]          /proc/gpio/poe_passthrough
[   14.250000] linux-kernel-bde (330): Created a iProc BCM switch device BA=48000000 IRQ=194 device=0x8344
[   14.490000] Ubiquiti: system 0xeb63 revision 1
[   14.490000] PCI: enabling device 0000:01:00.0 (0140 -> 0142)
[   14.500000] linux-kernel-bde (330): Payload size of 256 exceeds device capability
[   50.730000] Received 2 PSE boards registered with pid 740
[   55.640000] device eth0 entered promiscuous mode
[_/su_spoiler]
If the first character of N (bytes or lines) is a ‘+’, output begins with the Nth item from the start of each file, otherwise, print the last N items in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).


tar

Create, extract, or list files from a tar file.

tar -[czjaZxtvO] [-X FILE] [-f TARFILE] [-C DIR] [FILE(s)]...

Options:
        c       Create
        x       Extract
        t       List
Archive format selection:
        z       Filter the archive through gzip
        j       Filter the archive through bzip2
        a       Filter the archive through lzma
        Z       Filter the archive through compress
File selection:
        f       Name of TARFILE or "-" for stdin
        O       Extract to stdout
        exclude File to exclude
        X       File with names to exclude
        C       Change to directory DIR before operation
        v       Verbose


tc
This command is only available on UniFi AP devices.

Show / manipulate traffic control settings.

tc [ OPTIONS ] OBJECT { COMMAND | help }
tc [-force] -batch file

where  OBJECT := { qdisc | class | filter | action | monitor }
       OPTIONS := { -s[tatistics] | -d[etails] | -r[aw] | -b[atch] [file] }


tcpdump

Dump traffic on a network.

tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ]
                [ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]
                [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
                [ -W filecount ] [ -y datalinktype ] [ -Z user ]
                [ expression ]


tee

Copy standard input to each FILE, and also to standard output.

tee [OPTIONS] [FILE]...

Options:
        -a      Append to the given FILEs, do not overwrite
        -i      Ignore interrupt signals (SIGINT)


telnet

Connect to telnet server.

telnet [-a] [-l USER] HOST [PORT]

Options:
        -a      Automatic login with $USER variable
        -l USER Automatic login as USER


telnetd

Handle incoming telnet connections.

telnetd [OPTIONS]

Options:
        -l LOGIN        Exec LOGIN on connect
        -f ISSUE_FILE   Display ISSUE_FILE instead of /etc/issue
        -K              Close connection as soon as login exits
                        (normally wait until all programs close slave pty)
        -p PORT         Port to listen on
        -b ADDR[:PORT]  Address to bind to
        -F              Run in foreground
        -i              Run as inetd service
        -w SEC          Run as inetd service in wait mode, linger time SEC
        -S              Log to syslog (implied by -i or without -F and -w)


test

Check file types, compare values etc. Return a 0/1 exit code depending on logical value of EXPRESSION.

test [ EXPRESSION ]


tftp

Transfer a file from/to tftp server.

tftp [OPTIONS] HOST [PORT]

Options:
        -l FILE Local FILE
        -r FILE Remote FILE
        -g      Get file
        -p      Put file
        -b SIZE Transfer blocks of SIZE octets


time

Run PROG. When it finishes, its resource usage is displayed.

time [OPTIONS] PROG [ARGS]

Options:
        -v      Verbose
Example

The following example shows how to time simple program execute and display verbose resource usage when complete.

# time -v sleep 5
        Command being timed: "sleep 5"
        User time (seconds): 0.01
        System time (seconds): 0.00
        Percent of CPU this job got: 0%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0m 5.01s
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 94
        Voluntary context switches: 2
        Involuntary context switches: 0
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
[_/su_spoiler]


tinysnmpd

Daemon to respond to SNMP request packets.

tinysnmpd [options] <configfile> <modulepath>

    -f | --logfile=FILENAME   Location of log file. By default, messages will be
                              logged to the console.

    -s | --syslog=FACILITY    The following facilities can be specified:

                                  authpriv  security/authorization messages
                                  cron      clock daemon
                                  daemon    system daemons without separate facility
                                  ftp       ftp daemon
                                  kern      kernel messages
                                  lpr       line printer subsystem
                                  mail      mail subsystem
                                  news      usenet news subsystem
                                  syslog    messages generated internally by syslogd
                                  user      generic user-level messages
                                  uucp      uucp subsystem
                                  local0    reserved for local use
                                  ...
                                  local7

                              If this option is specified, messages will be logged
                              to syslog. By default, messages will be logged to the
                              console.

    -l | --loglevel=LEVEL     The following levels can be specified (in increasing
                              order of verbosity):

                                  quiet     No messages will be logged
                                  errors    Only errors will be logged
                                  warnings  Warnings & errors will be logged
                                  normal    Default messages and all of the above
                                  verbose   Verbose messages will also be logged
                                  debug     Log debug messages as well
                                  noisy     Noisy debug messages will be logged as well

                              If a log file or facility is specified, tinysnmpd defaults to
                              `verbose', otherwise, `noisy' is selected.

    -d | --daemon             Run in the background. You need to specify a log file or
                              a syslog facility if you want to use this option.

    -h | --help               Show this help message.

    <configfile>              Location of tinysnmpd configuration file.

    <modulepath>              Path where mib libraries reside.


top

Provide a view of process activity in real time. Read the status of all processes from /proc each SECONDS and show the status for however many processes will fit on the screen.

top [-b] [-nCOUNT] [-dSECONDS] [-m]
Example: UniFi AP AC (UAP-ACv2)

The following example shows how to display process activity in real time.

# top
Mem: 49404K used, 76628K free, 0K shrd, 4532K buff, 15908K cached
CPU:   0% usr   0% sys   0% nice  99% idle   0% io   0% irq   0% softirq
Load average: 0.00 0.00 0.00
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
  544     1 ubnt     S     3724   3%   1% /bin/mcad
 1359  1063 ubnt     S     1072   1%   0% /bin/dropbear -F -d /var/run/dropbear
  546     1 ubnt     S     3576   3%   0% /bin/mca-monitor
  535     1 ubnt     S     3572   3%   0% /bin/reset-handler
 1072     1 ubnt     S     2360   2%   0% /bin/hostapd /etc/aaa1.cfg
 1360  1359 ubnt     S     1400   1%   0% -sh
 1058     1 ubnt     S     1372   1%   0% /sbin/udhcpc -f -i br0 -V ubnt -A 10
    1     0 ubnt     S     1356   1%   0% init
  900     1 ubnt     S     1356   1%   0% /usr/bin/crond -c /etc/crontabs -l 5
  533     1 ubnt     S     1356   1%   0% init
 1385  1360 ubnt     R     1352   1%   0% top
 1071     1 ubnt     S     1352   1%   0% /bin/syslogd -n -O /var/log/messages
  534     1 ubnt     S     1348   1%   0% /usr/bin/klogd -c 8 -n
 1067     1 ubnt     S     1172   1%   0% /bin/stamgr -i 1
 1063     1 ubnt     S      980   1%   0% /bin/dropbear -F -d /var/run/dropbear
 1102     1 ubnt     S      628   0%   0% /sbin/ntpclient -i 86400 -n -s -c 0 -
  246     1 ubnt     S      564   0%   0% /sbin/hotplug2 --persistent --set-rul
   70     2 ubnt     SW<      0   0%   0% [mtdblockd]
    4     2 ubnt     SW<      0   0%   0% [events/0]
    2     0 ubnt     SW<      0   0%   0% [kthreadd]
[_/su_spoiler]
Example: UniFi Switch 48 750W (USW-48P-750)

The following example shows how to display process activity in real time.

# top
Mem: 93228K used, 163380K free, 0K shrd, 0K buff, 43040K cached
CPU:  13% usr   0% sys   0% nic  36% idle   0% io   0% irq  50% sirq
Load average: 1.50 1.71 1.81 2/142 1854
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
  740   717 ubnt     S    86124  34%  14% switchdrvr boot
  879     1 ubnt     S     5092   2%   0% /bin/uplink-monitor
  884     1 ubnt     S     4984   2%   0% /bin/mcad
  885     1 ubnt     S     4964   2%   0% /bin/mca-monitor
  877     1 ubnt     S     4960   2%   0% /bin/reset-handler
  741   717 ubnt     S     2668   1%   0% syncdb
 1631  1609 ubnt     S     1412   1%   0% -sh
    1     0 ubnt     S     1320   1%   0% init
  880     1 ubnt     S     1320   1%   0% /sbin/udhcpc -f -i eth0 -V ubnt -A 10 -s /etc/udhcpc/udhcpc -p /var/run/udhcpc.eth0.pid
  875     1 ubnt     S     1320   1%   0% init
 1854  1631 ubnt     R     1308   1%   0% top
  876     1 ubnt     S     1304   1%   0% /usr/bin/klogd -c 8 -n
  878     1 ubnt     S     1304   1%   0% /bin/syslogd -n -O /var/log/messages -l 7 -s 200 -b 0
 1609   883 ubnt     S     1148   0%   0% /bin/dropbear -F -d /var/run/dropbear_dss_host_key -r /var/run/dropbear_rsa_host_key -p 22
  883     1 ubnt     S     1060   0%   0% /bin/dropbear -F -d /var/run/dropbear_dss_host_key -r /var/run/dropbear_rsa_host_key -p 22
  717     1 ubnt     S      924   0%   0% /bin/procmgr
  945     1 ubnt     S      808   0%   0% /sbin/ntpclient -i 86400 -n -s -c 0 -l -h 0.ubnt.pool.ntp.org
  385     1 ubnt     S      604   0%   0% /sbin/hotplug2 --persistent --set-rules-file /usr/etc/hotplug2.rules
  279     2 ubnt     SW       0   0%   0% [spi1]
  313     2 ubnt     SW       0   0%   0% [mtdblock6]
  113     2 ubnt     SW       0   0%   0% [kswapd0]
  100     2 ubnt     SW       0   0%   0% [kworker/0:1]
    6     2 ubnt     SW       0   0%   0% [kworker/u:0]
    3     2 ubnt     SW       0   0%   0% [ksoftirqd/0]
    5     2 ubnt     SW<      0   0%   0% [kworker/0:0H]
    8     2 ubnt     SW       0   0%   0% [migration/0]
    9     2 ubnt     SW<      0   0%   0% [khelper]
   10     2 ubnt     SW       0   0%   0% [kdevtmpfs]
   77     2 ubnt     SW       0   0%   0% [bdi-default]
    4     2 ubnt     SW       0   0%   0% [kworker/0:0]
  283     2 ubnt     SW       0   0%   0% [mtdblock0]
    7     2 ubnt     SW<      0   0%   0% [kworker/u:0H]
  293     2 ubnt     SW       0   0%   0% [mtdblock2]
  298     2 ubnt     SW       0   0%   0% [mtdblock3]
  303     2 ubnt     SW       0   0%   0% [mtdblock4]
  288     2 ubnt     SW       0   0%   0% [mtdblock1]
   11     2 ubnt     SW       0   0%   0% [kworker/u:1]
  320     2 ubnt     SW<      0   0%   0% [deferwq]
   79     2 ubnt     SW<      0   0%   0% [kblockd]
  308     2 ubnt     SW       0   0%   0% [mtdblock5]
    2     0 ubnt     SW       0   0%   0% [kthreadd]
  156     2 ubnt     SW       0   0%   0% [fsnotify_mark]
[_/su_spoiler]


touch

Update the last-modified date on the given FILE[s].

touch [-c] [-d DATE] FILE [FILE]...

Options:
        -c      Do not create files
        -d DT   Date/time to use


tr

Translate, squeeze, and/or delete characters from standard input, writing to standard output.

tr [-cds] STRING1 [STRING2]

Options:
        -c      Take complement of STRING1
        -d      Delete input characters coded STRING1
        -s      Squeeze multiple output characters of STRING2 into one character
Example

The following example shows how to translate a mixed case string to upper case.

# echo uBiQuIti nEtWorKs | tr a-z A-Z
UBIQUITI NETWORKS
[_/su_spoiler]


traceroute

Trace the route to HOST.

traceroute [-FIldnrv] [-f 1st_ttl] [-m max_ttl] [-p port#] [-q nqueries]  
           [-s src_addr] [-t tos] [-w wait] [-g gateway] [-i iface]  
           [-z pausemsecs] HOST [data size] 

Options:
        -F      Set the don't fragment bit
        -I      Use ICMP ECHO instead of UDP datagrams
        -l      Display the ttl value of the returned packet
        -d      Set SO_DEBUG options to socket
        -n      Print hop addresses numerically rather than symbolically
        -r      Bypass the normal routing tables and send directly to a host
        -v      Verbose
        -m max_ttl      Max time-to-live (max number of hops)
        -p port#        Base UDP port number used in probes
                        (default 33434)
        -q nqueries     Number of probes per 'ttl' (default 3)
        -s src_addr     IP address to use as the source address
        -t tos          Type-of-service in probe packets (default 0)
        -w wait         Time in seconds to wait for a response
                        (default 3 sec)
        -g              Loose source route gateway (8 max)


true

Return an exit code of TRUE (0).

true
ABCDEFGHIJKLMNOPQRSTUVWXYZ
⇐ BackPageNext ⇒

Ubiquiti UniFi Command-Line Interface Reference

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

Leave a Reply