The Command Line — Your best friend
Tags: terminal, developer, softwaredevelopment, zsh
Published: 2019-03-06 21:22:56

---
title: The Command Line — Your best friend
published: true
tags: terminal,developer,software-development,zsh
canonical_url: https://medium.com/@codingsam/the-command-line-your-best-friend-a9e660e78fb2
---

The command line is a tool used by software developers, to run framework or development tools related commands, run scripts to automate processes and a lot more. If you are learning to code or already code, I think you should not be afraid of the command line. It can seem intimidating at first, but it will improve your workflow.

I met some people that always ran away from anything that didn’t have a GUI (Graphical User Interface). In some cases, you will be just fine. For instance, if you are a C# developer, you will use Visual Studio. Actions related to running, debugging and deployment can be triggered just by clicking in some icons in the IDE (Integrated Development Environment), in this case, Visual Studio. There is nothing wrong with this approach but… When you try to explore other technologies, languages, frameworks, etc, you end up dealing with the command line.

If you are already a software developer, at this point, your reaction should be something like:

<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FcEYFeDKVPTmRgIG9fmo%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FcEYFeDKVPTmRgIG9fmo%2Fgiphy-downsized.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FcEYFeDKVPTmRgIG9fmo%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="390" frameborder="0" scrolling="no"><a href="https://medium.com/media/0aa640dad9d0aa8f10d4709e424b8bae/href">https://medium.com/media/0aa640dad9d0aa8f10d4709e424b8bae/href</a></iframe>

> “What are you talking about? I know how to open the Terminal app on my Mac or Linux or cmd on Windows and run commands in it”.

I am not here to tell you that you must learn how to use the command line… Instead, let me show you, from my experience, how you can have the best command line… Ever!

First, let me tell you how I learned what I am about to share with you. Everything started when I was in a summer internship at a startup. I was a student looking for some kind of real world experience, so I was not really familiar with the command line. The CTO (Chief Technology Officer) showed me how to have a Quake like console (the one that comes down when you press the ‘\’ key in Quake video game) on my laptop that was running Linux. Then, he told me to install _oh-my-zsh_, which I will talk about later in this post.

![](https://cdn-images-1.medium.com/max/637/1*8_M_UVHiOx6CfY8tgl-mnA.png)<figcaption>Console in Quake game</figcaption>

The CTO is basically the person that is in charge of the technology and engineering departments of a given company.

From that moment, I started to love the command line. Few years later I still use this tool and I am going to share it with you.

Basically, you will need these things:

- A terminal app
- Z Shell
- oh-my-zsh

I will explain what these things are in a moment.

Just follow the two steps below :)

### First — Get a nice terminal app

The first thing to do is to get a terminal app. You can use the one that comes with your Operating System but there are better solutions out there, especially for Windows, believe me, you wouldn’t want to use _cmd_. The goal here is to have a better terminal app with a Unix based command line. Unix is the base system of Mac and Linux Operating Systems. This is why I prefer Mac or Linux, and maybe that’s why you see a lot of developers using such systems. Anyway, if you use Windows you can still get almost the same experience.

Here are my terminal apps recommendations for Mac, Linux and Windows.

- **Mac** : [iTerm](https://www.iterm2.com/)

![](https://cdn-images-1.medium.com/max/1024/1*yRnyT30la5AukGoDkzG2_Q.png)<figcaption>Iterm2 running on my own Macbook Pro</figcaption>

- **Linux** : [Guake](http://guake-project.org/)

![](https://cdn-images-1.medium.com/max/1024/1*dirfG6Rb4J3hbxc0aRjAHQ.jpeg)<figcaption>Guake running on Ubuntu. Source: <a href="https://www.flickr.com/photos/xmodulo/14285529772">https://www.flickr.com/photos/xmodulo/14285529772</a></figcaption>

- **Windows** : [ConEmu](https://conemu.github.io/)

![](https://cdn-images-1.medium.com/max/672/1*SCiK5lLCZjdlEAOY7CkBrg.png)<figcaption>ConEmu running on Windows. Source: <a href="https://commons.wikimedia.org/wiki/File:ConEmu_screenshot.png">https://commons.wikimedia.org/wiki/File:ConEmu_screenshot.png</a></figcaption>

In the Windows, installing just ConEmu will not give you the best experience. You need to install [WSL (Windows Subsystem for Linux)](https://docs.microsoft.com/en-us/windows/wsl/install-win10) and a Linux distribution available in the Windows Store, for instance, [Ubuntu](https://www.microsoft.com/p/ubuntu/9nblggh4msv6#activetab=pivot:overviewtab).

This will give you a Unix like command line, which is what this entire post is all about.

I think using one of the terminal apps I mentioned before, it is already an improvement… But let’s make it even better…

### Second — Make your terminal awesome

I will just show you something that you can install, to have, what I think is the best command line experience possible.

Now, you need to install two things:

- [_Z Shell_](http://zsh.sourceforge.net/), which is essentially an Unix shell (command line interpreter). The installation will depend on your Operating System. I recommend that you use a package manager. On Windows, if you successfully installed the Linux Subsystem, just use the package manager available in your Linux distribution you are using inside the WSL. If you use Linux, you can just use the package manager of your distribution. On Mac OS, I recommend you to use [_Home Brew_](https://brew.sh/)_._
- [_oh-my-zsh_](https://ohmyz.sh/)_,_ is a set of plugins that adds more features to the _Z Shell_. The installation process is just a matter of copy and pasting a command to your terminal. Depending on the installation method you choose, you need _wget_ or _curl_. Just use your package manager to install one of these two options.

If you made this far, let me show you how awesome this is!

### See it in action

Let’s see some examples of cool things you can do with the terminal and _oh-my-zsh_ together.

All the following screenshots were taken from a Mac OS, because I own a Macbook Pro… But if you installed a terminal app and ‘oh-my-zsh’, you will be able to experience the same awesomeness.

- **Plugins**

You have a lot of plugins available. [Check the complete plugins list](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) and how to install them. Is as simple as add the plugins names to the _plugins_ list in the _.zshrc_ file in your user’s home folder.

<iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80c061172fa043dadb7e68ae287a08c7/href">https://medium.com/media/80c061172fa043dadb7e68ae287a08c7/href</a></iframe>
- **Choose a theme**

_oh-my-zsh_ allows you to customize the look and feel of your terminal. I just use the default one, but you are free to give it a different look. Choosing a theme just requires you to define a _ZSH\_THEME_ variable in your _.zshrc_ file. [Check all the available themes](https://github.com/robbyrussell/oh-my-zsh/wiki/themes) and set this variable according to your choice. For instance, if you want to use a theme named “[_awesomepanda_](https://github.com/robbyrussell/oh-my-zsh/wiki/themes#awesomepanda)_”,_ you need to add the following to the _.zshrc_ file:

<iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bdb7a2c906ea7f790c93c9540ccff24f/href">https://medium.com/media/bdb7a2c906ea7f790c93c9540ccff24f/href</a></iframe>
- **Using git**

If you use _git_ as the version control of your projects, you know you can use the command line for that. If you navigate to any of your projects folders, you will see the current branch’s name in the right side of the folder’s name. You also have some aliases to make your git commands shorter.

- git pull => gl
- git push => gp
- git commit => gc
- git status => gst

See this in action…

![](https://cdn-images-1.medium.com/max/1024/1*u2PYNP6CFuwhMdG4sbLW8g.gif)<figcaption>Using git with oh-my-zsh</figcaption>

- **Autocomplete**

Maybe you already know that, when you are typing a command, if you press the _TAB_ key, the terminal will try to complete your command. This is already a cool thing. But… _Z Shell_ and _oh-my-zsh_ take this autocomplete thing to another new level. That’s right, it can help you, for instance, to complete a folder name even if you start typing a word in the middle. If more than one option is available, you can use the _TAB_ key to navigate through the available options.

![](https://cdn-images-1.medium.com/max/1024/1*schkIWY2CsGb7VSt_bS5DA.gif)<figcaption>Autocomplete feature for folders and files</figcaption>

Another awesome level of autocomplete, is related with some software development tools. You have several plugins to help you autocomplete some specific tools commands. For instance, if you work with _nodejs_, you will use a lot of _npm_ commands, like _npm install_.

![](https://cdn-images-1.medium.com/max/1024/1*GwySiHrVJzHoISnYlJ3Dqg.gif)

> Because you know, developers are lazy, so they will avoid to write as much as possible.

### Conclusion

Any software developer has to deal with the command line. Some people don’t like it. Unless you work with a really specific tool set, bad news… You can’t run away from it. I can tell you that, from my experience, it can seem intimidating in the beginning because it requires you to memorize a lot of commands. But… once you begin feeling comfortable, you will love it.

Following two simple steps, you can have a really awesome experience. You just need to download a terminal app for your Operating System. Then, go ahead and install _z shell_ and _oh-my-zsh_ on top of it.

If you are a software developer or thinking about being one, remember…

> The command line is as important as any other development tool

![](https://cdn-images-1.medium.com/max/1024/1*CioB717snwMtfEBeomP01A.gif)<figcaption>Having fun with the command line :)</figcaption>

I talked about the terminal and _oh-my-zsh_ but didn’t go into much detail of the installation process of each required package. That would require a post for each Operating System. The most important thing here, is that you become aware of these tools. Let me know if you would like to read about each OS. I think you have the best experience in Mac and Linux. At my current job, I use a Windows laptop. I came from a Macbook from my previous job, so I was used to a kind of Unix based experience. Fortunately, Microsoft somehow partnered with Ubuntu. This partnership allows you to have a Linux command line in your Windows. Anyway, sometimes there are problems… But I can write about that in a new post.

> Share this post with software developers that are in the beginning of their careers or always try to run away from the command line :)