Tail Options For Viewing A File

Tail is useful to view by default the last 10 lines of a file. If you’re viewing logs or similar, sometimes you only need to see the latest output. Tail to the rescue! Get familiar with the options to view files efficiently on your local or remote system.

-f, --follow                cause tail to look forever, checking for new data at the end
                            of the file. If new data appears it will print it.

-n {num}, --lines={num}     Output the last num lines. -n 20 for example. The default is 10.
                            Output the last number of lines

Tail can also output multiple files at once and will output the name of the file at the top of the output:

> tail yarn.lock header.html
==> yarn.lock <==
    get-caller-file "^1.0.1"
    os-locale "^1.4.0"
    read-pkg-up "^1.0.1"
    require-directory "^2.1.1"
    require-main-filename "^1.0.1"
    set-blocking "^2.0.0"
    string-width "^1.0.2"
    which-module "^1.0.0"
    y18n "^3.2.1"
    yargs-parser "^5.0.0"

==> header.html <==
<header class="bg-image grid">
    <div class="col-12 grid">
        <div class="col-12 logo logo--home"></div>
        <p class="col-12 tagline text-center">A dev community</p>
    </div>
</header>

Read more about it here

Instagram Post