• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Working with Terminal

Contents

  • Working with Terminal
    • Solarized Dark Theme
    • Oh-my-ZSH Installation
    • ZSH and Bash
    • Some usefull tools
      • ack
    • Windows

I've just switched from Bash to ZSH because of oh-my-ZSH. I think this is just the right time to explain the words Shell, command line, Terminal, Bash and ZSH.

Terminal is an terminal emulator, sometimes also called a "terminal window". I work in a window environment (MATE) and I want to use command line tools within that environment. So I need a "terminal window":

Terminal Window with ZSH and Bash
Terminal Window with ZSH and Bash

ZSH and Bash are both Unix shells. A shell is a command line interpreter that provides a text-based user interface.

Command line describes the textual way you interact with the computer. When you're in a graphical user interface situation you interact by manipulating windows with your keyboard/mouse. When you're in a text-based user interface situation, you interact by entering commands in a line (hence command line).

Solarized Dark Theme

The Solarized Dark Theme is very good for command line. It can be installed like this as explained here:

$ git clone https://github.com/oz123/solarized-mate-terminal.git
$ cd solarized-mate-terminal
$ ./solarized-mate.sh dark

restart the terminal.

Oh-my-ZSH Installation

Oh-my-ZSH is a plugin for ZSH. I think this plugin is very good and makes a big difference to Bash. So when you look at the screenshots below, keep in mind that this is not a "plain vanilla" zsh.

  • Install "Oh-my-ZSH"
  • Install "powerline fonts" and change your Terminal font to one of them
  • Change your Terminal theme to "agnoster" by setting ZSH_THEME="agnoster" in ~/.zshrc
  • Set your terminal theme to "Solarized Dark" (description)
  • Make ZSH your default Shell in MATE Terminal (description) and eventually sudo chsh -s /usr/bin/zsh username

ZSH and Bash

Here are some differences. On the left side is zsh, on the right is bash:

  • Bash vs zsh: cd command completion
  • Bash vs zsh: Git prompt indicator
  • Bash vs zsh: Spelling correction
  • Bash vs zsh: time command

I like the time command of bash more, but that's it. All other interactions are either almost the same or better in zsh. I especially like that zsh doesn't print everything again when you autocomplete with tab. And it also autocompletes when you make an capitalization error.

I also begin to like the Git-specific prompt indicators:

ZSH 'git add' indicator
ZSH 'git add' indicator

Some usefull tools

ack

You might already know grep. And if you've worked with it, you might already have typed something like the following:

grep --exclude-dir=".svn" "searchterm" *
grep -rI "onlytextSearchterm" .

An alternative to grep is ack (for Ubuntu users: ack-grep). See beyondgrep.com.

Windows

It seems to be possible to get something similar (the same?) for Windows. See OH MY CYGWIN.


Published

Okt 22, 2013
by Martin Thoma

Category

Code

Tags

  • Bash 7
  • Command Line 7
  • Linux 17
  • Shell 5
  • Software Development 15
  • Terminal 1
  • ZSH 1

Contact

  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor