查看磁盘清除日志

df -hl 查看磁盘剩余空间
df -h 查看每个根路径的分区大小

cd /
du -lh --max-depth=1

排除某个目录--exclude=
du -lh / --max-depth=1 --exclude="proc"

查看/root目录下一级文件大小
du -lh /root --max-depth=1

删除
find 「日志目录」 -mtime +5 -name ".log." -exec rm -rf {} ;

查看docker容器占用内存

[root@bjc-yuji-123013 ~]# docker ps -a
CONTAINER ID        IMAGE                                                        COMMAND                  CREATED             STATUS                       PORTS                                            NAMES
a7a90a60c31b        minio/minio                                                  "/usr/bin/docker-ent…"   4 weeks ago         Up 4 weeks                   0.0.0.0:8000->9000/tcp, 0.0.0.0:8001->9001/tcp   minio_dev

[root@bjc-yuji-123013 ~]# ps -ef | grep a7a90a60c31b
'root     20041 19231  0 11:30 pts/16   00:00:00 grep --color=auto a7a90a60c31b
root     23644  5365  0 5月11 ?       00:01:36 containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/a7a90a60c31ba6a27e83f0eac83c9bbaae0e522e617eb7111e089568d163a651 -address /run/containerd/containerd.sock -containerd-binary /usr/bin/containerd -runtime-root /var/run/docker/runtime-runc


[root@bjc-yuji-123013 ~]# top -p 20041

top - 12:16:38 up 274 days, 19:53, 13 users,  load average: 1.66, 1.76, 1.77
Tasks:   0 total,   0 running,   0 sleeping,   0 stopped,   0 zombie
%Cpu(s):  4.2 us,  1.3 sy,  0.0 ni, 94.0 id,  0.4 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem : 13181313+total,   696888 free, 12466595+used,  6450296 buff/cache
KiB Swap: 67108860 total, 27152420 free, 39956440 used.  6292144 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND