Yes, use the --tail flag with the desired number of lines. For example, docker compose logs --tail=20 web represents the last 20 lines from the \\"web\\" service logs.