My Reading List from July 16, 2022 to July 31, 2022.
|Things I wish everyone knew about Git (Part I)
|The opposite of
git-push is not
|Things I wish everyone knew about Git (Part II)
|Good advice is commit early and often
|Shell productivity tips and tricks
|We will cover some shell features you can leverage to make your shell do more of the work for you.
|Tips & Tricks
|6 deprecated Linux commands and the tools you should be using instead
|Swap your old Linux commands for new and improved alternatives that provide the same functionality, if not more.
|Tips & Tricks
I don't need to know how it works. I just want to know which commands to run. But with Git, this does not work. ——Mark Dominus
I have been using GitHub for two years. Before the spring this year, what I did most is clicking the buttons in VSCode's Git panel to pull, stage changes, commit, and push to GitHub. These buttons are what "Git everything" means to me.
On October 8, 2021, I was asked a question during a Project Manager interview. The interviewer asked me "What is
git rebase?". I know nothing about that command. After the interview, my friend told me that the
git rebase is a professional command, and must be used with caution.
From the blog, something interesting about Git is:
git-resetdoes up to three different things, depending on flags. For more details, see git-reset.
The opposite of
It is very hard to permanently lose work. If something seems to have gone wrong, don't panic. Remain calm and ask an expert. ——Mark Dominus
Since my job now is inseparable from Git, I have learned to use high-level or high-risk commands like
git amend, though I still know nothing about Git. You might lose your work if operated incorrectly, but don't panic, just backup before executing high-risk commands and then you can do anything.
Finding old stuff with
Though it is really hard to lose work,
git reflog can help you recover some worktree histories. I have not used it before, but I tried it and the command lists the places where
HEAD has been, which seems useful to me in the future.
Good advice is Commit early and often. If you don't commit, at least add changes with git-add. Files added but not committed are saved in the repository, although they can be hard to find because they haven't been packaged into a commit with a single SHA id. ——Mark Dominus
Yes, it is necessary to commit often with a meaningful commit message.
When you are typing in your shell, I suggest you treat the Tab key as a superpower.
Auto-completion is a great feature. I am using Fig to add visual autocomplete to my shell.
This article introduces some keyboard shortcuts when using the shell or vi. With these shortcuts, you can navigate the current line, edit, cut, paste, and control your terminal.
This week, I found the Control+A shortcut which is to go to the beginning of the line I am currently typing on. This shortcut saves me from relying on the ←. Shortly after I used the Control+A, Twitter recommends a tweet below about
readline to me.
好奇有些零碎的知识如何系统性学习。在没有一个已经系统学习过的人来带的话，感觉几乎是不可能的任务。— whsloef (@whsloef) July 25, 2022
直到前几天我才知道，之所以ctrl+a ctrl+e 在zsh里面能进行行首和行尾的跳转，是因为有个东西叫做readline. (1 / N)
The shell uses a library called
readline to provide you with many keyboard shortcuts to navigate, edit, cut, paste, search, etc, in the command line.
The default shortcuts are inspired by the
emacs terminal-based text editor.
emacs isn't the only famous text editor in the history of computers though: another one, dating back from 1976, is
emacs are designed in two very different ways, and have two very different logics.
I don't know
readline before, and I just want to know which shortcuts I can use. But I still add this pages into my reading list 👀.
While the obvious way to re-execute a previous command might seem to just bash on the ↑ key until you find the command you want, there are faster and smarter ways to accomplish this.
I usually type some commands frequently and use ↑ to find commands. The article introduces the Control+R which helps to navigate through history. This is really useful when API testing 🥳.
- To extend regular expression pattern, use
grep -Einstead of
- To search for the specified strings in a file, use
grep -Finstead of
- To resolve a domain, use
- To display network connections, use
- To get the network interface configuration, use
- To manipulate entries in the kernel routing tables , use
ip routeinstead of