shell 脚本

Bourne Again Shell (/bin/bash)Linux系统默认的shell

#!(告诉系统其后路径所指定的程序既是解释此脚本文件的shell程序)/bin/bash

创建完成要修改权限 chmod +x ./test.sh

command >> file 将输出以追加方式重定向到file

-f 检测文件是否是普通文件 如果是 返回true

if condition

then

  command 1

  command 2

  ...

fi

if [$(ps -ef | grep -c "ssh") -gt 1]; then echo "true"; fi 写成一行

原文地址:https://www.cnblogs.com/hiraeth/p/8607923.html