18.01.2020 Views

Working with Linux

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2. Productive Shells – Reinvent the way

you work

In this chapter, we will start off with a short introduction to Vim and look at the most basic commands

to help you get started with basic CRUD (create, read, update, delete) operations. We will then

upgrade the shell interpreter to zsh and also give it superpowers with the awesome oh-my-zsh

framework. We will look at some basic regular expressions such as searching some text using grep.

Then, we will unleash the power of Unix pipes and run embedded commands using subshells. The

later part of the chapter will help us understand how we can boost productivity and automate a lot of

our day-to-day work by showing some of the more advanced shell scripting techniques.

In this chapter, we will cover the following:

Working with Vim

Managing zsh using the oh-my-zsh framework

Writing and running super powerful one line commands using pipes and subshells

Exploring the shell scripting libraries

We will focus on editing files. For that we need to choose a file editor. There are a bunch of options

but considering that the fastest way to edit files is, of course, without leaving the terminal. We

recommend Vim. Vim is an awesome editor! It has a lot of configuration options with a huge

community that has produced lots of plugins and beautiful themes. It also features advanced text

editing, which makes it ultra-configurable and super-fast.

So, let's proceed. Open the terminator and type sudo apt install vim to install Vim:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!