'docker tail -n not showing correct no. of lines

If I run the following docker tail command:

docker logs --tail all    8f8df1de5f9c |& wc -l
645

It reports 645 lines

If I then run:

docker logs --tail 645    8f8df1de5f9c |& wc -l
550

It shows a reduced no. of lines.

I would have expected both commands to show the same no. of lines?

P.S. I'm writing unit tests so I need to know how many lines are available and then I need to run the command requesting exactly that no. of lines.

The docker version is:

docker --version Docker version 19.03.13, build 4484c46

I'm running on ubuntu 20.04 with a zfs file system.



Solution 1:[1]

If you want to read 250 line of file you must write this command

tail -n 250 pageName.blade.php 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bayaz