Reading List about Tips & Tricks
Lists
Reading List | Inspiration |
---|---|
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. |
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. |
Shell productivity tips and tricks
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
举个例子,readline
直到前几天我才知道,之所以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 vi
. vi
and 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 🥳.
6 deprecated Linux commands and the tools you should be using instead
- To extend regular expression pattern, use
grep -E
instead ofegrep
. - To search for the specified strings in a file, use
grep -F
instead offgrep
. - To resolve a domain, use
dig
instead ofnslookup
. - To display network connections, use
ss
instead ofnetstat
. - To get the network interface configuration, use
ip
instead ofifconfig
. - To manipulate entries in the kernel routing tables , use
ip route
instead ofroute
.