常用命令
- 有参考价值
- 2025-06-27
- 39热度
这个命令会列出所有进程,按CPU使用率降序排序,并显示前10个最占CPU的进程。
ps -eo pid,ppid,cmd,%cpu --sort=-%cpu | head -n 11
Linux 查看占用内存前10的命令
ps aux|head -1;ps aux|sort -rn -k4|head -10
ubuntu 设置root密码并开放root ssh
设置root密码:sudo passwd root
设置放开root ssh
sudo nano /etc/ssh/sshd_config
修改:PermitRootLogin yes
最后:sudo systemctl restart sshd
docker 设置加速镜像
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://docker.1ms.run"]
}
EOF
sudo systemctl restart docker
lunix下让git记住账号密码
git config --global credential.helper store
手动触发trim
fstrim -v /path/to/mountpoint