做兼职的网站,理财网站免费建设,网站商城运营模式,做网站需要用到的软件文章目录 Linux系统命令内存相关文件相关 GitGit常用的shell脚本 整理如下#xff0c;随时补充更新#xff1a;
Linux系统命令
内存相关
# 查看内存占用最高的进程
ps aux --sort-%mem | head
ps aux --sort-%cpu | headtop#xff0c;按照M按照内存排序#xff0c;按下… 文章目录 Linux系统命令内存相关文件相关 GitGit常用的shell脚本 整理如下随时补充更新
Linux系统命令
内存相关
# 查看内存占用最高的进程
ps aux --sort-%mem | head
ps aux --sort-%cpu | headtop按照M按照内存排序按下P按照CPU排序按下E转换为KB/MB/GB
文件相关
# 查看当前磁盘占用
df -h# 查看当前目录大小
du -sh# 查看当前目录下第一层文件夹的大小按照由大到小排序
du -sh * | sort -rh (文件过多的话可以加 | less)# 同上但可以指定层级
du -lh --max-depth1 | sort -rh# 查看进程打开的文件
lsof | grep xxx (记得加上grep否则返回的数据会很多)
Git
# 查看全局配置和远程仓库地址
git config --global --list
git remote -v# 修改全局配置
git config --global user.name renxing
git config --global user.email renxingqq.com
git config --global alias.s status # 起个别名之后可以用 git s 代替 git status下同
git config --global alias.c checkout
git config --global alias.d diff
git config --global alias.p pullGit常用的shell脚本
# git提交代码并直接合并到 test 分支 的shell脚本
# 运行方式: sh git-push-merge-test.sh 提交代码的备注信息#提交本地代码
if [ ! -n $1 ] ;thenmark修改
elsemark$1
figit pull
git add .
git commit -m $mark
git push#获取当前分支名称
now_branch$(git branch --show-current)
echo $now_branch#切换到test分支,然后合并当前分支,push后,再次回到当前分支
git checkout test
git pull
git merge $now_branch
git push
git checkout $now_branch