linux shell command里有两个我没用过但是看上去蛮不错的:
tree和history。
history <number> 会从第<number>个command开始,在terminal里逐一打印出你之前用过的command。
tree的话就是展示出你当前文件夹下的文件目录结构。(见下图)
#systemProgramming
(12)
`find . -name "src" -type d`
`find . -path "*/test/*.python" -type f`
d: directory; f: file
`find . -mtime -1`
find all files modified in the last day
`find . -size +500k -size -10M -name '*.tar.gz'`
Find all zip files with size in range 500k to 10M
(13)
You can also use `find` to execute some commands:
`find . -name "*.tmp" -exec rm {}`
——我很好奇这个花括号是怎么用的。
(14)
https://tldr.sh/
tldr gives you examples of each flag of a shell command.
(9)
question mark ? will only match 1 letter. `ls clas?` will list files in the class directory.
(10)
the first line of the script
#!/usr/bin/python
can be replaced by
#!/usr/bin/env python
if you don't know the path of python
(11)
Curly braces {} - Whenever you have a common substring in a series of commands, you can use curly braces for bash to expand this automatically. This comes in very handy when moving or converting files.
#systemprogramming #shell
(5)
in shell command, `true` will always have a 0 error code and `false` will always have a 1 error code.
(6)
`false && echo "Oops fail"`, the second part won't be executed.
Using a semicolon `;` in the middle is a way to concatenate 2 commands.
(7)
to use the output of a command:
`$(command)`
example: `echo "we are in $(pwd)"`
(8)
$0 the name of the script
$# the number of arguments
$$ the process ID of the script
$@ all the arguments
(1)
echo "value is $foo"
echo 'value is $foo'
variables in single quote will not be replaced.
(2)
You can define a function in a .sh file and then source it. Then you can use this function in your terminal.
(3)
$? will get you the error code from the previous command.
$_ will get you the last argument of the previous command.
(4)
in shell, `!!+tab` = your previous command.
(15) f+<letter>: jump to the location of the next <letter>
(16) F+<letter>: jump back to the previous location of <letter>
(17) x: delete the current letter.
(18) r+<letter>: replace the current location with <letter>
(19) ctrl+r: redo
(20)
yy: copy the current line into buffer
yw: copy the current word
(21)
in visual mode, ctrl+v: select a block
这个可以用于txt文件表格中固定列的选取。
#vim #systemprogramming
(8) ctrl + u上一页; ctrl+d下一页
(9) G: move all the way down
(10) gg: move all the way up
(11) o/O: insert a line after/before and then change to the edit mode
(12)
d+w: delete a word.
d+e: delete to the end of the current word
c+w/c+e: the same functionality as d+w/d+e, but change to the edit mode in the end
(13)
dd: delete the line
cc: delete the line and then change to the edit mode.
(14)
cap+H/M/L: change to the top/middle/end of the current page
(1) counts:
7dw: delete 7 words
4j: right move 4 letters
(2) modifier:
a: around
i: inside
=========
ci[ : change everything inside []
----
%: jump back and force between parentheses
----
da( : delete everything inside () including the parentheses itself.
----
/<keyword> + n: next match of the keyword.
----
. : repeat the previous editing command
中文版的C++版算法课(b站)
转码应该有用吧。
#systemProgramming
vim的几种mode,以及其从normal mode进入的方式:
i: insert mode
r: replace mode
v: visual mode
- visual mode line: <s-v>
- visual mode block: <c-v>
: command mode
我用了很久vim竟然不知道有replace mode这个模式。
#systemprogramming
从科普的角度讲,虽然大部分内容我都知道(尤其是硬件相关),但是诸如file system,network system相关的内容我还是想再看看。所以姑且收藏在这mark一下。
https://www.bilibili.com/video/av21376839
做好了之前说的个人博客样板间,我是您时间轴上的个人博客推广大使。
主题采用CaiJimmy的Stack,增加了之前经常被人问到的个人魔改,感兴趣的人可以看这篇文章:Hugo | Hugo-stack-theme 主题魔改版
示例站点可以看这里:Demo站,完全装修好的样子可以看我的个人博客:小球飞鱼
主要特色如下:
应该是最简单的Hugo博客搭建方式,一共只需要四步:1.Fork仓库并Download到本地;2.导入仓库到Vercel;3.在本地安装Hugo;4.花十分钟学习一下使用Github Desktop。(详细教程文章中有)
基于原主题特性,魔改后基本囊括了个人博客所需的绝大部分功能,开箱即用,不需折腾,有使用说明:友情链接,分类/TAG/归档小部件/全文搜索/归档页面/文章字数统计/站点总字数统计/建站时间统计。
基于原主题进行了大量样式细调,美观性经过时间检验,人见人夸,不打诳语
文章中对一些常见博客修改做了总结,并附赠七篇我折腾时写的流水账笔记,便利装修查阅。
如果您喜欢或使用这个魔改版主题成功搭建了自己的个人博客,欢迎评论告诉我,我会很开心的!
@board
#长毛象安利大会
#长毛象安利交换大会
做了一个URL清洁器,可清理链接中的追踪参数 。在ClearURLs的规则集基础上添加了微信公众号和部分淘宝规则。
https://tools.o3o.studio/clearurls
发带链接的嘟嘟前记得先给URL洗个澡哦
#URL
Kateです。アメリカのペン大でコンピューターシステムを研究している大学院生です。日本語を勉強しているから少し話せます。ビデオゲームが大好きです。
FC:SW-8149-0004-0143
PSN:kate0115