实用shell笔记

linux 下 取进程占用 cpu 最高的前10个进程

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head

linux 下 取进程占用内存(MEM)最高的前10个进程

ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head

一键更新镜像

适用于vps、wsl

bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)

免输入密码

前两行是ssh的,最后一个是git免输密码

ssh-keygen
ssh-copy-id root@ip


git config --global credential.helper store

Git: Failed sending HTTP2 data解决办法

sudo apt reinstall libcurl3-gnutls/stable

查看指目录下的n条提交记录

git log -n 20 --stat .

查看当前目录下文件夹大小

du -h

du -ha -d 1  | sort -nr | head -n 20

NFS

服务端

# /etc/exports
/opt/ *(rw,async,insecure,no_root_squash)

挂载远程目录到当前

mount -t nfs www.example.top:/opt /mnt/nfs
posted @ 2021-10-10 12:50  大白也没我白  阅读(39)  评论(0)    收藏  举报