Save time when working with the command line

Tools to automate working with operators and improve code readability.





Photos - Kevin Ku - Unsplash




Navi




This is a tool for viewing and storing cheat sheets with command line operations. Displays lists of UNIX / Linux statements and suggests the necessary arguments. You can either create templates yourself or download:



$ navi search <cmd>
      
      







/ How navi works: gif image from the official repository



According to the developer, now there is no need to copy the result of one command to the clipboard to paste it into the next. Navi also acts as a widget for the shell. However, so far it is available only for the zsh and bash shell. The issue of supporting others is decided in a special thread on GitHub - everyone can connect.



Navi has many analogues - for example, bro , eg , cheat.sh , tldr , cmdmenu and cheat . A resident of Hacker News also noted that similar functionality is already built into Linux. In particular, they had in mind the ~ / bin directory, where self-written scripts are placed . However, the author of navi says that the alternatives do not have a clear UI and cannot automatically substitute the necessary arguments.



The tool can be tested online at katacoda. The platform will launch the docker container and provide all the instructions for starting navi, however, registration is required.




Z




This shell script makes it easy to navigate directories on the command line. With it, you can not use cd and ls (dir) to switch between directories. The tool remembers which directories you visit and assigns them a special weight coefficient - frecency (from the English “recent” and “frequency”). When you open a folder, its frequency response increases by one, while it receives a flag “recently visited”. After that, just transfer the name of the folder to the utility, and it will open it automatically.



 //    /var/www/staging/wp-content/themes : $ z themes //      : $ z staging themes
      
      





When the sum of the frequency coefficients of directories exceeds 9000, they are all multiplied by 0.99. As a result, folders whose coefficient is less than one are forgotten.



Today Z has more than 10 thousand stars on GitHub, but despite its popularity, it has flaws. Residents of Hacker News note that in comparison with analogues, the tool has limited functionality - for example, the fasd utility performs transitions not only by the name of directories, but also by file names. It is also worth noting that similar functionality can be achieved using the standard tool $ CDPATH - a list of frequently visited folders. However, in this case, directories will have to be entered manually.




Bat




On UNIX-like systems, cat is used to sequentially read and send the contents of files to standard output. Cat has an analogue - bat, but with additional improvements: syntax highlighting and integration with git. The utility was developed by David Peter , a German physicist who worked on bat in his spare time.



/ Screenshot from Bat repository on GitHub



Bat can highlight the syntax of programming languages ​​such as C #, C ++, Erlang, Go, Groovy and many others. You can get acquainted with the full list by writing the command:



 $ bat --list-languages
      
      





In the left column, where numbers are affixed, the utility also shows changes in the file — added lines, changed names, and so on — since the last commit. Another bat feature is support for automatic swapping. It makes it possible to read conclusions sequentially: page by page.



In general, the tool has collected positive reviews. Around him even formed a large community - more than 15 thousand stars on GitHub. But still there were people who did not appreciate bat. According to them, such utilities run counter to the UNIX concept - Do One Thing And Do It Well (“A program should do one thing and do it well”), therefore the bat functionality was considered “redundant”. The tasks that bat is responsible for are solved by a set of other tools - for example, awk for parsing text files and entr (1) for building a project after modifying the sources.



Benchmarks for servers on Linux:



Temci, Uarch-bench, Likwid, Perf-tools and Llvm-mca

Sysbench, UnixBench, Phoronix Test Suite, Vdbench, and IOzone

Iometer, DD, vpsbench, HammerDB and 7-Zip



Other materials from our blog and social networks:



Personal data: security features

Securing your Linux system: 10 tips

Risk minimization: how not to lose your data

File backup: how to be safe from data loss

How to transfer a system hard drive to a virtual machine?



How to create a virtual server in 1cloud.ru

WebAssembly technology - how it works



PS Our API for cloud management, monitoring and server scaling.



All Articles