docker 内查看文件时间 docker动态查看日志最后100行

ls -all

docker动态查看日志最后100行:

docker logs -f -t --tail=1 chat2db

docker logs OPTIONS CONTAINER

Options:

--details 显示更多的信息

-f, --follow 跟踪实时日志

--since string 显示自某个timestamp之后的日志,或相对时间,如42m(即42分钟)

--tail string 从日志末尾显示多少行日志, 默认是all

-t, --timestamps 显示时间戳

--until string 显示自某个timestamp之前的日志,或相对时间,如42m(即42分钟)

查看指定时间后的日志,只显示最后100行:

docker logs -f -t --since="2018-02-08" --tail=100 CONTAINER_ID

查看最近30分钟的日志:

docker logs --since 30m CONTAINER_ID

查看某时间之后的日志:

docker logs -t --since="2018-02-08T13:23:37" CONTAINER_ID

查看某时间段日志:

docker logs -t --since="2018-02-08T13:23:37" --until "2018-02-09T12:23:37" CONTAINER_ID

相关推荐
Filwaod3 分钟前
MCP 接入模式对比:Agent - Gateway - 业务项目 vs Agent - Adapter - 业务项目
java·agent·mcp
kuonyuma11 分钟前
MyBatis入门·注解操作
java·spring boot·mysql·spring·mybatis
木雷坞12 分钟前
LiteLLM Docker 部署:config.yaml、Master Key 和 Postgres 配置
运维·docker·容器·litellm
码界索隆17 分钟前
Python转Java系列:面向对象基础
java·开发语言·python
DIY源码阁22 分钟前
JavaSwing酒店管理系统 - MySQL版
java·mysql·eclipse
川石课堂软件测试22 分钟前
UI自动化测试|元素操作&浏览器操作实践
功能测试·测试工具·mysql·ui·docker·容器·单元测试
丑过三八线26 分钟前
Docker Podman 启动命令
docker·容器·podman
不恋水的雨41 分钟前
easyexcel快速填充大数据量不覆盖后面的行解决方式
java·excel·poi
r-t-H41 分钟前
Docker进阶与容器编排实践-第三章
运维·docker·容器
范什么特西43 分钟前
Maven中dependencies和dependencyManagement区别
java·开发语言·maven