notes icon indicating copy to clipboard operation
notes copied to clipboard

linux 常用指令集合

Open lanlin opened this issue 7 years ago • 1 comments

指令 说明
df -h 查看磁盘各分区大小、已用空间等信息
du -sh foo 查看foo目录的大小
du -sh * 列举当前位置所有子目录大小
su -s /bin/bash -c "command" use_name 以 nologin 账户执行指令
kill -l 列举信号列表 ()
pkill -f xxx 杀死名为 xxx 的进程 (可配合信号使用)
pkill '^xxx$' 可以用 ^ 或者 $ 进行前后缀匹配
top -p pgrep xxx | head -n 20 | paste -sd "," - top xxx进程的资源占用情况
find . -name "*.text" -type f -print -exec rm -rf {} ; 查找并删除当前目录下所有text类型的文件

lanlin avatar Mar 09 '18 02:03 lanlin

后台运行

指令

nohup command >/dev/null 2>&1 &    // 后台运行,不记录输出

nohup command >> nohup.log 2>&1 &  // 后台运行,记录输出

示例

nohup ./bin/kibana --allow-root >/dev/null 2>&1 &

lanlin avatar Feb 07 '21 07:02 lanlin