CS61C Lab0 杂谈
Lab0提到了一句话,Each lab will begin with a few objectives; use them to reflect on your learning and guide your thinking!
我想这就是学习它的原因,guide your thinking 才是最核心的部分。
有用的命令行技巧
<ctrl> + a 会将cursor移动至当前行开头
<ctrl> + e 会将cursor移动至当前行结束
总结:helpful for fixing mistakes
man - Manul Pages
借用Dan的评价:
They also work offline, so they can be handy if you’re ever stuck in a North Alaskan woodland cabin in the middle of a snowstorm basking in the dying glow of a ThinkPad which BTW runs Arch Linux.
While your favorite search engine probably also has the answers you’re looking for, in this course, we’d still like you to get comfortable with using
man
, especially for C and UNIX-related questions.
一般来说,我们会选择
man command_name | less
这样通过pipeline将man page传递给less,这个页面可以通过鼠标滚动查看
也可以通过关键词查找
man -k single_keyword | less
SSH - "Secure Shell"
为了远程连接机器,当然这里的介绍就比较简陋了,详情还是可以参照6.NULL
1、如果长时间nothing happens,需要检查网络连接或者防火墙设置
2、连接成功后,就可以与远程机器进行交互和输入命令
3、如果需要退出SSH会话,使用exit即可
SCP - "Secure Copy"
scp用于使用SSH协议在计算机之间复制文件。
如果先从远程机器中获取单个文件或者整个文件夹又或者是发送过去,就可以使用SCP命令
$ scp <source> <destination>
To specify a remote source or destination, use
username@host:path
. To specify a local destination, just usepath
.
如果是复制文件夹,则加上“-r” Flags即可
Vim Basics
当然这些基本都是基本操作,可以说如果不会Vim宏,那就是根本不会Vim。但现在有了Vs code之后其实不是特别需要Vim,当然能写Shell这个基操还是得有的。
Fun with Git
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
拉取最新的代码
git pull origin master
P.S. (尽量用SSH协议,HTTP有很多坑,包括SSL之类的,绝对不要用HTTP协议)