跳到主要内容

Reading List about Tips & Tricks

Lists

Reading ListInspiration
Shell productivity tips and tricksWe 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 insteadSwap your old Linux commands for new and improved alternatives that provide the same functionality, if not more.

Shell productivity tips and tricks

quote

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.

quote

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 👀.

quote

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 of egrep.
  • To search for the specified strings in a file, use grep -F instead of fgrep.
  • To resolve a domain, use dig instead of nslookup.
  • To display network connections, use ss instead of netstat.
  • To get the network interface configuration, use ip instead of ifconfig.
  • To manipulate entries in the kernel routing tables , use ip route instead of route.