rsync 忽略 node_modules 目录

你可以使用 rsync 命令来复制 packages 目录内的所有文件到 target 目录,同时忽略 node_modules 目录。以下是一个示例 Bash 脚本:#!/bin/bash # 源目录 source_directory="./source/" # 目标...

执行远程 bash 脚本

bash <(curl -sL https://git.io/JUO6r)curl -L 参数可以跟踪301跳转Execute bash script from URL

用 diff 命令生成 patch,用 patch 命令打 patch

最近遇到了很多停更的 github 仓库,作者已明显放弃了维护。当我们需要修改软件包源代码的时候,就麻烦了。如果自己 fork 后发布重新发布新包,维护成本比较高。对于这种情况,更高效的办法是通过打 patch 的方式来修正软件包的代码。下面介绍一下具体的实现办法:为单个文件生成补丁复制源文件...

Mac 终端 tab 自动补全

安装brew install bash-completion查看brew info bash-completion添加配置Add the following line to your ~/.bash_profile: [ -f /usr/local/etc/bash_completion ...

Google Cloud VM 自动创建快照脚本

Automatic Snapshots for Google (gcloud) Compute EngineBash script for Automatic Snapshots and Cleanup on Google Compute Engine. Requires no user in...

Shell输出彩色文字

在默认情况下,linux终端输出的文字并不是彩色的。那么,如果想让linux输出彩色文本,那么应该怎么做呢? `echo -e"\e[1;颜色代码m显示的文字\e[0m"`红色:31绿色:32黄色:33蓝色:34洋红:35青色:36白色:37黑色:38