tail [OPTION]... [FILE]...
tail [OPTION]... [FILE]...
$ cat << EOF > test.txt
123
456
789
101112
131415
161718
192021
222324
252627
282930
313233
343536
373839
EOF
$ tail test.txt
101112
131415
161718
192021
222324
252627
282930
313233
343536
373839
$ tail test.txt test2.txt
==> test.txt <==
101112
131415
161718
192021
...
==> test2.txt <==
a
a
...
$ tail -n 3 test.txt
313233
343536
373839
$ tail -n +3 test.txt
789
101112
131415
161718
192021
222324
252627
282930
313233
343536
373839
$ tail -c +21 test.txt
31415
161718
192021
222324
252627
282930
313233
343536
373839
$ tail -f test.txt
101112
131415
161718
192021
222324
252627
282930
313233
343536
373839
$ echo "new line" >> test.txt
$ tail -f test.txt
101112
131415
161718
192021
222324
252627
282930
313233
343536
373839
new line
$ tail -n 3 test.txt test2.txt
==> test.txt <==
343536
373839
new line
==> test2.txt <==
a
a
a
$ tail -n 3 -v test.txt test2.txt
343536
373839
new line
a
a
a
$ tail -n 3 -v test.txt
==> test.txt <==
343536
373839
new line
$ tail -F test.txt
101112
131415
161718
192021
222324
252627
282930
313233
343536
373839
t
tail: 'test.txt' has become inaccessible: No such file or directory
tail: 'test.txt' has appeared; following new file
t
$ cat << EOF >> pid_test_shell.sh
#!/bin/bash
while true
do
sleep 1
done
EOF
$ chmod +x pid_test_shell.sh
$ ./pid_test_shell.sh &
[1] 8201
$ tail -f test.txt --pid 8201