pwd 查看路径
bash --version 查看bash当前版本
echo hello world
- echo 输出多行文本需要把多行文本放到引号里面
- echo -n hello world // 输出末尾不加换行符
短路逻辑依旧存在 && ||
type 判断内部外部命令
- type echo // echo is a shell builtin
- type ls // ls is hashed (/bin/ls)
ctrl-L 替代 clear
ls ?.txt 匹配单名的txt文件
stat 是加强版的ls
touch 创建空文件
cat 显示文本的文件内容
#!/usr/bin/env sh
set -e
npm run build
cd dist
git init
git add -A
git commit -m 'deploy'
git push -f git@github.com:ryanchosen/diandi-financials-demo.git master:gh-pages
cd -
npm run build &&
git checkout github-pages &&
rm -rf src *.sh *.js *.json &&
mv dist/* ./ &&
rm -rf dist &&
git add . &&
git commit -m 'update' &&
git push &&
git checkout -