This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Mac版: | |
| 1.全局搜索:double `shift` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. git branch -vv //查看本地分支关联(跟踪)的远程分支之间的对应关系 | |
| git branch -u origin/demo //建立当前本地分支与远程分支的映射关系,建立关系以后才能 pull和push | |
| git branch --set-upstream-to origin/demo //同上 | |
| git branch --unset-upsteam //撤销当前本地分支与远程分支的映射关系 | |
| 2. git push <远程主机名> <本地分支名>:<远程分支名> //git push的完成操作命令, 其中当远程分支跟本地分支有追踪关系时,远程分支可以省略, | |
| 所以git push origin master中的 master 指的是本地的master分支 | |
| 3. git remote update <远程仓库名> // 用于更新远程仓库的所有分支信息 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- log4j 转 slf4j 工具 https://logback.qos.ch/translator/--> | |
| <!-- For assistance related to logback-translator or configuration --> | |
| <!-- files in general, please contact the logback user mailing list --> | |
| <!-- at http://www.qos.ch/mailman/listinfo/logback-user --> | |
| <!-- --> | |
| <!-- For professional support please see --> | |
| <!-- http://www.qos.ch/shop/products/professionalSupport --> | |
| <!-- --> | |
| <configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git diff --cached 比较暂存区和HEAD的文件差异 | |
| git log --stat 查看提交历史记录, 其中--stat会显示文件的历史变化 | |
| git diff 比较差异 | |
| git log --pretty = oneline | |
| git status -s 精简指令 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tee 多重输出 | |
| eg: | |
| $ cat a.txt|tee copy.txt | |
| // 将 a.txt 的内容输出到标准输出的同时,输出到 copy.txt 文件 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 肥朝: https://www.jianshu.com/p/5f7846d5d072; https://juejin.im/user/592ad6220ce463006b28d8a9 | |
| Nutty: https://www.cnblogs.com/ygj0930/p/6542811.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://zhedahht.blog.163.com/blog/static/2541117420072250322938/ | |
| [递归方法]: | |
| class Solution { | |
| public: | |
| int LastRemaining_Solution(unsigned int n, unsigned int m) | |
| { | |
| if(n==0) | |
| return -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| awk语法:awk是这样操作的,读入有'\n'换行符分割的一条记录,然后将记录按指定的域分隔符划分域,填充域。 | |
| $0则表示所有域, | |
| $1表示第一个域, | |
| $n表示第n个域。 | |
| 默认域分隔符是"空白键" 或 "[tab]键". 也可以通过 -F 指定分隔符 | |
| $ awk '{pattern+action}' {filename} | |
| NF:每行的字段数; | |
| $NF:最后一列字段; | |
| NR:总共读了多少行;NR表示从awk开始执行后,按照记录分隔符读取的数据次数,默认的记录分隔符为换行符, | |
| 因此默认的就是读取的数据行数,NR可以理解为Number of Record的缩写 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 输入重定向: < | |
| 输出重定向: > | |
| 标准输入: 0 | |
| 标准输出: 1 | |
| 错误输出: 2 | |
| Linux Shell 环境中的输入输出重定向,用符号<和>来表示。0、1和2分别表示标准输入、标准输出和标准错误。 | |
| 1.重定向标准输出到文件: | |
| cat foo > foo.txt | |
| 2.重定向标准错误到文件 | |
| cat foo 2> foo.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. 如何向脚本传递参数 | |
| ./script argument | |
| eg: | |
| ./show.sh file1.txt | |
| $cat show.sh | |
| #!/bin/bash | |
| echo $1 | |
| 2.使用脚本中的参数: | |
| 第一个参数: $1, 第二个参数 $2 |
OlderNewer