If you're on a Unix system you probably have to constantly interact with the terminal, one way or another.So, the more you can speed up your terminal workflow, the more efficiently you can get work done. I want to share my personal favorite command line tools that will boost your productivity and help you save time. Let's begin -
1. z.sh
Z is a command line tool that allows you to jump quickly to directories that you have visited frequently in the past, or recently -- but most often a combination of the two (a concept known as "frecency"). It works by keeping track of when you go to directories and how much time you spend in them. It is then in the position to guess where you want to go when you type a partial string, e.g. "z src" might take you to ~/src/zsh.
Use case:
- Quickly going to the right directory in your local machine.
2. tmux
Tmux is a terminal multiplexer: Essentially this means that tmux lets you tile window panes in a command-line environment. This way, you can run and track multiple programs from the same terminal, saving you the hassle of constantly having to shift terminal windows. Tmux also lets you "detach" your terminal sessions and get back to them later without the session being interrupted, a lifesaver for long running server tasks.
Use Cases:
- Easily traverse multiple command line windows
- Keep a terminal session or task alive for a long time without keeping your computer open.
- Easily manage tasks on a remote server
3. how2
how2 is a command line utility to quickly search up programming tasks in natural language. It's like Stackoverflow, but for the command line. Using Stackoverflow and Google API, how2 immediately gives you the most likely answer. You can also go into the interactive mode and search through all the results. How2 saves me a lot of time because I don't have to switch to the browser to search for simple things.
Use Cases:
- Quickly find a code snippet to execute a shell task
- Find code snippets for common problem in programming language of choice.
4. fzf
fzf is a fuzzy text finder for pretty much anything in your system. fzf can help you find files in your computer, previous commands in your shell history, results from a search or anything else. fzf is incredibly flexible because it supports searching through the results of any other unix command. All you need to do is pipe the results to fzf. Eg -
ls | fzf
This video does a great job in explaining all the cool things you can do with fzf.
Use Cases:
- Search for files in your system or in a directory
- Search through results of another command like
ls
orgrep
5. tldr
tldr is an attempt to simplify verbose & lengthy man pages for common unix commands and tools. tldr pages are simple, approachable and prioritizes the common use cases. This makes tldr ideal to quickly get an idea about any new command.
Let's look at an example. Want to know how to do a grep in case insensitive mode? tldr it!
Conclusion
These are the five tools that I felt have saved me a ton of time in doing my work as a developer. They're also general purpose enough to be utilized and enjoyed by a wide range of professionals and hobbyists. What unix programs has been the most helpful in your experience? Feel free to share your favorites with me!
If you liked this article, do check out my blog.
Acknowledgements
- This article was inspired by the post: Ask HN: Programs that saved you 100 hours? on Hacker News.
- The credits for the gifs belong to their respective creators.
Top comments (17)
great list! check out cheat.sh also seems similar to how2
Thank for the suggestion!
From my first impression, this seems very much like tldr.
Awesome post!
Thank you, hope you found something you liked!
Definitely!
How2 is something I'm definitely going to try.
Thanks for sharing!
lol you missed one
github.com/knqyf263/pet
custom snipppet.toml
paste.xinu.at/yZu6H/
This is pretty cool. I think oh-my-zsh's autocomplete features covers a part of this use-case for me so never really thought of using a snippet manager.
Thanks for the info!
yeah i like teh fact it puts chosen snippet right on $PS1 to be executed.
teh shell function is handy
Great collection of tools.
Let me also recommend you check out ack ! It's grep on steroids:
beyondgrep.com/
Salamalaikum, jazakallah khair
Wa alaykum as-salam :)
Good post thanks for sharing it.
You're welcome, glad you liked it!
I can also recommend zsh-autosuggestions for everyone who has zsh as default shell.
Wow, "how2 " is very useful. I didn't know before. Thanks....
Welcome, glad you found something useful!