ai问答记录

118 阅读1分钟

1.linux

1.假设你的/dev/sda3分区挂载在/目录, /dev/sdb 挂载在/data目录,你想查询 /dev/sda3分区内文件的大文件要怎么处理?
如果执行这个 sudo find / -type f -size +1G -exec ls -lh {} + | sort -rh, 会把/data目录下的东西也查出来,你可以这样问ai : find the 10 largest files in the /dev/sda3 partition mounted on /, while ignoring other mount points like /data, you can use the following command: 这样基本就可以查出来了,主要是增加一个-mount选项: find / -mount -type f -size +100M -exec ls -lh {} + | sort -rh | head -n 10

image.png

  1. 查询/目录下特定日志之前创建的目录,只查询一层: find / -maxdepth 1 -type d -not -newermt "2024-08-16" -ls

image.png

2. kubectl命令相关

1.查询全部占用gpu资源的pod: kubectl get pods -o=custom-columns=NAME:.metadata.name,GPU:.spec.containers[*].resources.limits.nvidia\.com/gpu -A | grep -v ''