# multitail(1) - man - phpman

> **TLDR:** Extension of tail.
>
- Tail all files matching a pattern in a single stream:
  `multitail -Q 1 '{{pattern}}'`
- Tail all files in a directory in a single stream:
  `multitail -Q 1 '{{path/to/directory}}/*'`
- Automatically add new files to a window:
  `multitail -Q {{pattern}}`
- Show 5 logfiles while merging 2 and put them in 2 columns with only one in the left column:
  `multitail -s 2 -sn 1,3 {{path/to/mergefile}} -I {{path/to/file1}} {{path/to/file2}} {{path/to/file3}} {{path/to/file4}}`

*Source: tldr-pages*

---

[MULTITAIL(1)](https://www.chedong.com/phpMan.php/man/MULTITAIL/1/markdown)                           General Commands Manual                          [MULTITAIL(1)](https://www.chedong.com/phpMan.php/man/MULTITAIL/1/markdown)



## NAME
       MultiTail - browse through several files at once

## SYNOPSIS
       **multitail** **[**_options_**]**

       options: **[-cs|-Cs|-c-]** **[-s]** **[-i]** **inputfile** **[-i** **anotherinputfile]** **[...]**


## DESCRIPTION
       The program **MultiTail** lets you view one or multiple files like the original tail program. The
       difference is that it creates multiple windows on your console (with ncurses).  It  can  also
       monitor wildcards: if another file matching the wildcard has a more recent modification date,
       it will automatically switch to that file. That way you can, for example, monitor a  complete
       directory  of  files.  Merging of 2 or even more logfiles is possible. It can also use colors
       while displaying the logfiles (through regular expressions), for faster recognition  of  what
       is  important and what not. It can also filter lines (again with regular expressions). It has
       interactive menus for editing given regular expressions and deleting and adding windows.  One
       can  also  have windows with the output of shell scripts and other software. When viewing the
       output of external software, MultiTail can mimic the functionality of tools like 'watch'  and
       such. When new mail arrives for the current user, the statuslines will become green. To reset
       this "mail has arrived"-state, press ' ' (a space). For help at any time, press F1.


## OPTIONS
### -i file
              Select a file to monitor. You can have multiple **-i** _file_ parameters.  You only need  to
              add **-i** _file_ in front of a filename if the filename starts with a dash ('-').

### -I file
              Same as **-i** _file_ but add the output to the previous window (so the output is merged).

### -iw file interval
              **-Iw**  **file**  **interval**  Like '-i'/'-I' but expects the parameter to be a wildcard and the
              second(!) an interval.  Initially MultiTail will start monitoring the first file  with
              the  most recent modification time. Every interval it will check if any new files were
              created (or modified) and start tailing that one.  *Don't  forget*  to  put  quotation
              marks around the filename as otherwhise the shell will try to substitute them!

### -l command
              Command  to execute in a window. Parameter is the command. Do not forget to use "'s if
              the external command needs parameter! (e.g. -l "ping host").

### -L command
              Same as **-l** but add the output to the previous window (so the output is merged).

### -j

### -J -j

### --mergeall
              Merge all of the following files into the same window (see '--no-mergeall').

### --no-mergeall
              Stop merging all files into one window (see '--mergeall');

### --no-repeat
              When the same line is repeated, it will be suppressed while printing a  "Last  message
              repeated x times" message.

### --mark-interval x
              Print every 'x' seconds a mark-line when nothing else was printed.

### -q i path
              Check  path  for  new files with interval 'i', all in new windows. One can enter paths
              here understood by the shell. E.g. "/tmp/*". Note: do not forget to add quotes  around
              the pathname to prevent the shell from parsing it!

### -Q i path
              Like -q: but merge them all in one window.

### --new-only
              For -q/-Q: only create windows for files created after MultiTail was started.

### --closeidle x
              Close windows when more then 'x' seconds no new data was processed.

### -a
              Note: you need to put "-a file" BEFORE to the file you're monitoring!

### -A
              Also see the note for "-a".

### -g

### -G

### -S

### -t title
              With  this  switch,  "title" is displayed in the statusline instead of the filename or
              commandline.

### -n
              Number of lines to tail initially. The default depends on the size  of  the  terminal-
              window.

### -N
              Like -n but this parameter will be used for all files/commands you tail after this pa‐
              rameter.

### -r interval
              Restart the command (started with -l/-L) after it has exited. With  interval  you  can
              set how long to sleep before restarting.

### -R interval
              Restarts  a  command  like -r only this one shows the difference in output compared to
              the previous run.

### -rc / -Rc interval
              Like -r / -R but clears the window before each iteration.

### -h

### -f

### --follow-all
              For all files after this switch: follow the following filename, not the descriptor.

### -fr filter
              Use the predefined filter(s) from the configfile.

### -e

### -ex
              The command gets as commandline parameter the whole matching line.

### -eX
              expression with '(' and ')'.

### -ec

### -eC
              matches inverted.

### -E

### -v

### -s

### -sw

### -sn

### -wh

### -cS scheme
              Show  the  next given file using the colorscheme selected with 'scheme' (as defined in
              multitail.conf).

### -CS scheme
              Show all following files using the colorscheme selected with 'scheme' (as  defined  in
              multitail.conf).

### -csn

### -cs

### -c

### -Cs

### -C

### -Cf
              Show all following files in color depending on field selected with field_index. Fields
              are delimited by the defined delimiter.

### -cf
              Show the next file in color depending on field selected with field_index.  Fields  are
              delimited by the defined delimiter.

### -ci color
              Use a specific color. Usefull when merging multiple outputs.

### -cT terminalmode
              Interpret terminal codes. Only ANSI supported at this time.

### -c-

### -C-

### -ts

### -Z color
              Specify the color-attributes for the markerline.

### -T

### -d

### -D

### -du

### -z

### -u

### -m nlines
              Set buffersize Set **nlines** to 0 (zero) if you want no limits on the buffering.

### -mb

### -M nlines
              Set the buffersize on ALL following files.

### -p x [y]
              Set linewrap: a = print everything including linewrap. l = just show everything start‐
              ing at the left until the rightside of the window is  reached.  r  =  show  everything
              starting  from  the  right of the line. s = show everything starting with the process‐
              name. S = show everything starting after the processname. o = show everything starting
              at offset 'y'.

### -P x [y]
              Like -p but for all following windows.

### -ke

### -kr x y
              Strip parts of the input starting at offset x and ending (not including!) offset y.

### -kc x y
              Strip parts of the input: strip column 'y' with delimiter 'x'.

### -ks

### -w

### -b

### --config filename
              Load the configuration from given filename.

### -x
              %l with the load of the system, %m with "New mail!" when  the  current  user  has  new
              mail, %u with the current effective user, %t timestamp of last changed file, %% with a
              %

### -o configfile-item
              Proces a configurationfile item via the commandline in case you cannot  edit  the  de‐
              fault configfile.

       **--cont** Reconnect lines with a '´ at the end.

### --mark-interval interval
              When nothing comes in, print a '---mark---' line every 'interval' seconds.

### --mark-change
              When  multiple  files  are  merged  an multitail switches between two windows, print a
              markerline with the filename.

### --no-mark-change
              Do NOT print the markerline when the file changes (overrides the configfile).

### --label text
              Put "text" in front of each line. Usefull when merging multiple files and/or commands.

### --retry
              Keep trying to open the following file if it is inaccessible.

### --retry-all
              Like --retry but for all following files.

### -cv

### --basename
              Only display the filename (and not the path) in the statusline.

### -F file
              Use 'file' as configfile (instead of default configfile).

### --no-load-global-config
              Do NOT load the global configfile.

### --beep-interval x
              Let the terminal beep for every x-th line processed. Press 'i' in the main menu to see
              how many times it beeped.

       **--bi** **x** Like  '--beep-interval' but only for current (sub-)window. Statistics on the number of
              beeps can be found in the statistics for this (sub-)window.  Press  't'  in  the  main
              menu.

### -H

### -V


## KEYS
       You  can  press a couple of keys while the program runs.  To see a list of them, press F1 (or
       ^h). You can press F1 (or ^h) at any time: it gives you context related  information.   Press
       'q' to exit the program.


## EXAMPLES
       See <http://www.vanheusden.com/multitail/examples.html> for more and other examples.

       **multitail** **/var/log/apache/access**___**log** **logfile** **-i** **-filestartingwithdatsh**
              This  creates  three windows. One with the contents of /var/log/apache/access_log, one
              with the contents of logfile and so on.

### multitail -R 2 -l "netstat -t"
              This runs netstat every 2 seconds and then shows what has changed since  the  previous
              run.  That  way  one  can see new connections being made and closed connections fading
              away.

### multitail logfile -l "ping 192.168.1.3"
              This creates two windows. One with the contents of logfile, one with with  the  output
              of 'ping 192.168.1.3'.

       **multitail** **/var/log/apache/access**___**log** **-I** **/var/log/apache/error**___**log**
              This  creates  **one**  window with the contents of /var/log/apache/access_log **merged** with
              the contents of /var/log/apache/error_log.

       **multitail** **-M** **0** **/var/log/apache/access**___**log** **-I** **/var/log/apache/error**___**log**
              Same as previous example. This example will store all logged entries in  a  buffer  so
              that you can later on browse through them (by pressing ' **b**
               ').


## BUGS
       As  this  program grew larger and larger over the time with new functionality sometimes added
       ad-hoc, some bugs may have been introduced. Please notify <folkert@vanheusden.com> if you  find
       any.

       Well,  except  for  the  resizing of your terminal window. The program might crash when doing
       such things. Upgrading the ncurses library to at least version 5.3 might help in that case.


## SEE ALSO
### <http://www.vanheusden.com/multitail/>


## NOTES
       This page describes **MultiTail** as found in the multitail-4.3.1  package;  other  versions  may
       differ  slightly.   Mail corrections and additions to <folkert@vanheusden.com>.  Report bugs in
       the program to <folkert@vanheusden.com>.



MultiTail                                      2007-02                                  [MULTITAIL(1)](https://www.chedong.com/phpMan.php/man/MULTITAIL/1/markdown)
