Official account: Java Xiaokaxiu, website: Javaxks.com

Source: author: switowski.com/blog/favorite-cli-tools

Translation: switowski.com/blog/favorite-cli-tools

Programmers in the development, the use of terminal CLI tools is essential, often are productivity tools, so today here to recommend you a better terminal tools. Here is a list of recommendations, as shown below.

Recommended high-frequency CLI tools

1, fish, shell

Without a doubt, Shell is the most frequently used and most important tool among terminal tools. I’ve used Bash and Z shells in the past, and now this Fish Shell, which is also an excellent terminal Shell tool, has many out-of-the-box features, such as syntax auto-recommendation completion, syntax highlighting, or using shortcuts to switch back and forth between recently accessed folders.

Download address:fishshell.com/

2, the Starship

If I had to pick one of my favorite terminal tools from this article, it would be Starship. Starship works with any Shell. You only need to install it, and then in the corresponding configuration file. Bashrc /. ZSHRC/config. The fish add a line configuration, the rest of the job to had it to do.

It can do:

  • Depending on whether you add new files to the repository, modify files, temporarily store files, etc., use symbols to indicate the status of the Git repository.
  • Show the Python version number based on the Python project directory you are in. This also applies to other programming languages such as Go/Node/Rust/Elm.
  • Displays how long it took for the last command to execute. The command must run in milliseconds.
  • If the previous command fails to execute, an error prompt is displayed.

There’s tons of other information to show. However, it can be intelligently presented to you in a friendlier form! For example, if you are not in a Git repository, it will hide Git information. If you are not in a Python project, there is no Python version information, because displaying it makes little sense. It never gives you redundant information and always keeps the terminal beautiful, elegant and simple.

Download address:starship.rs/

3, z

“Z” allows you to quickly jump between files and directories. It remembers the historical folders you visited, and after a brief learning, you can jump between directories using the z path_of_the_folder_name command.

For example, if I visit ~/work/ SRC /projects frequently, I can just run Z Pro and jump to it immediately. The principle of Z is based on the frecency algorithm, a statistical frequency and recency analysis algorithm. If it stores folders you don’t want to use, you can always manually delete them. It made it more efficient for me to switch frequently between different file paths, saved me keystrokes and saved me a lot of path memory.

Download address:github.com/rupa/z

4, FZF

FZF — Fuzzy Finder, or fuzzy finder. It is a general purpose tool that lets you use fuzzy search to find files, history commands, processes, Git commits, and more. You type in some letters, and it tries to match letters anywhere in the list of results. The more letters you type, the more accurate the result will be.

Download address:Github.com/junegunn/fz…

5, fd

The GIF above shows the use of the find command (left) and fd command (right).

Similar to the system’s own find command, but simpler to use, faster to find, and with good defaults.

Let’s say you’re looking for a file called “invoices,” but aren’t sure what the extension is, or you’re looking for a directory to store all invoices, not just one file. You can roll up your sleeves and start writing those complex regular expressions for the find command, or you can run FD Invoice directly from the command line.

By default, fd ignores hidden files and directories listed in. Gitignore. Most of the time, this is what we want, but in the rare cases where I need to disable this feature, I give the command an alias: fda=’ fd-ih ‘.

You’ll find that the color configuration of the fd command output is nice and, according to the benchmark (GIF above), even faster than the find command.

Download address:github.com/sharkdp/fd

6, ripgrep

The figure shows the comparison between grep (left) and Rg (right) commands.

Similar to the fd command, ripgrep is an alternative to grep, but it is faster, has a sound default configuration, and has rich color output.

Download address:Github.com/BurntSushi/…

7. Htop and Glances

The most common tool for displaying process health information on Linux or Mac is the familiar top, which is a good helper for every system administrator.

The HTOP tool is an excellent substitute for the TOP tool.

The TOP tool is a very basic monitoring tool that provides limited functionality, so many people turn to HTOP. Compared with TOP, HTOP has obvious advantages — in addition to more perfect functions, its color collocation is also very rich, and it is more friendly to use on the whole.

Glances also allows you to quickly see the current state of your system at a glance.

Glances is a complementary tool to HTOP. In addition to listing all the processes and their CPU and memory usage, it can also display other information about the system, such as:

  • Network and disk usage
  • Used space and total space of the file system
  • Data from different sensors, such as batteries
  • And a list of processes that have recently consumed too many resources

Htop download address: hisham. Hm/htop glances download address: nicolargo. Making. IO/glances

Virtualenv and VirtualFish

Virtualenv is a tool for creating virtual environments in Python.

VirtualFish is the virtual environment manager for the Fish Shell. It provides many commands to quickly create, list, or delete virtual environments.

Virtualenv: pypi.org/project/vir… Virtualfish: github.com/justinmayer…

Pyenv, Nodenv, and rBenv

Pyenv makes switching between Python versions easy.

Pyenv, NodenV, and RubyEnv are tools for managing different versions of Python, Node, and Ruby on your computer.

Suppose you want to install two versions of Python on your computer. For example, you are working on two different Python projects, or you still need to use Python2 because of special circumstances. Managing the different Python versions on a computer is complicated. You need to make sure that different projects have the correct version of the software dependencies. If you’re not careful, it’s easy to mess up this fragile configuration.

This tool provides a lot of help for versioning and makes this nightmare manageable. It can switch Python versions globally or “by folder”, and each version is isolated from the other.

Pyenv: github.com/pyenv/pyenv nodenv: github.com/nodenv/node… Rbenv can be downloaded at github.com/rbenv/rbenv

10, pipx

Virtualenv solves many problems in Python package management, but there is another solution. If I want to install a Python package in a global context (such as if it is a standalone tool, like the glances tool mentioned earlier), I run into problems with a global installation. Installing packages outside of a virtual environment is not a good idea and may cause unexpected problems in the future. On the other hand, if I decide to use a virtual environment, I need to activate that virtual environment every time I want to run the program. Nor is it the most convenient solution.

As it turns out, the PIPX tool can solve the above problems. It installs Python software dependencies into a separate environment (so there are no dependency conflicts). At the same time, the CLI commands provided by these tools are also available within the global environment. Therefore, I don’t need to activate any environment — PIpx does it for me!

Download pipxGithub.com/pipxproject…

11. Ctop and Lazydocker

Real-time monitoring example of CTOP

These two tools are very helpful when you are using Docker and monitoring it. Ctop is the top-level interface of the Docker container. It can do for you:

  • Displays a list of running and stopped containers.
  • Displays statistics, such as memory, CPU usage, and other details Windows for each container (such as bound ports and other information).
  • Provides a shortcut menu to quickly stop, kill, or display logs for a given container.

This is much more convenient than trying to figure out all this information from the Docker ps command.

Lazydocker is also a very useful Docker tool

Lazydocker is a very mature tool with terminal UI interface, providing very rich functions for Docker management.

Ctop download: github.com/bcicen/ctop Lazydocker download: github.com/jesseduffie…

12, Homebrew

If you’re on a Mac, there’s no need to talk about Homebrew. It is the industry’s accepted package manager for macOS.

Download address:brew.sh/

13, asciinema

Asciinema is a tool that can be used to log terminal sessions. However, unlike recording giFs, it lets the user select and copy the code from those recordings! This is great for recording coding tutorials. Asciinema recorded content, support direct copy, very powerful.

Download address:asciinema.org/

14, colordiff and diff-so-fancy

If you want to use the diff operation on the terminal (comparing the differences between two files), you can drop the diff command and use colordiff instead. The colordiff output can be highlighted, so it is much easier to view file differences than to wade through all the “<” and “>” symbols to compare file differences under the diff command output.

If that’s not enough for you, recommend diff-so-Fancy. It is a more user-friendly difference comparison tool than Colordiff.

It further improves the appearance of file content differences by:

  • Highlight the different words in each line, not the entire line
  • Simplify changing file titles
  • Remove the + and – symbols (color difference display is enough)
  • Clearly indicate new lines and deleted blank lines

Colordiff: www.colordiff.org/ diff-so-fancy: github.com/so-fancy/di…

15, tree

You can install the tool through brew Install tree. If you want to view the contents of a given directory, tree is a necessary tool to do this. It displays all subdirectories and files in a nice tree structure:

$tree...├ ── ├.md │ ├── ├.md │ ├── ├.cd │ ├── ├.cd │ ├.cd │ ├── ├.cd │ ├.cd │ ├── │ ├─ ├─ ├─ Start\ Screen\ Saver. Workflow │ ├─ │ ├─ Start\ Screen\ Saver brew-cask.shCopy the code

16, bat

Similar to the cat command commonly used in terminals to display the contents of files, but bat works better.

It adds syntax highlighting, git gutter flag (if applicable), automatic pagination (if the file is large), and makes the output more readable.

Bat download address:github.com/sharkdp/bat

17, httpie

If you need to send HTTP requests and find using curl not intuitive, try Httpie. Curl is a useful alternative to curl. Reasonable defaults and concise syntax make it easy to use, and the command returns are color output.

Httpiehttpie.org/

In the 18th and TLDR

Simplified version of the command help manual.

“Man Pages” shows too much information, but many times TLDR helps you find specific information faster, which is what users really want.

TLDR download address:tldr.sh/

19, exa

Exa is an alternative to the ls command.

It is brightly colored, displays other information such as Git status, automatically converts file sizes to human-readable units, and all at nearly the same speed as LS.

Exa download address:the.exa.website/

Litecli and PGCLI

This is a SQLite and PostgreSQL CLI solution. With autoprompt and syntax highlighting, they are much better than the default SQlite3 and PSQL tools.

Litecli: litecli.com/ pgcli: www.pgcli.com/

21, mas

Mas is a CLI tool for installing software from the App Store.

Mas Download addressgithub.com/mas-cli/mas

22, ncdu

This is a tool used in terminal disk analysis, it is simple and quick to use. Use this tool when you need to free up some hard disk space.

Ncdu download address:dev.yorhel.nl/ncdu

conclusion

The above recommended tools list is very long, friends can also use what amway out, communication and progress together.