Book Image

Working with Linux ??? Quick Hacks for the Command Line

By : Bogdan Vaida, Petru I»ôfan
Book Image

Working with Linux ??? Quick Hacks for the Command Line

By: Bogdan Vaida, Petru I»ôfan

Overview of this book

Websites, online services, databases, and pretty much every other computer that offers public services runs on Linux. From small servers to clusters, Linux is anywhere and everywhere. With such a broad usage, the demand for Linux specialists is ever growing. For the engineers out there, this means being able to develop, interconnect, and maintain Linux environments. This book will help you increase your terminal productivity by using Terminator, Guake and other tools. It will start by installing Ubuntu and will explore tools and techniques that will help you to achieve more work with less effort. Next, it will then focus on Terminator, the ultimate terminal, and vim, one of the most intelligent console editors. Futhermore, the readers will see how they can increase their command line productivity by using sed, find, tmux, network, autoenv. The readers will also see how they can edit files without leaving the terminal and use the screen space efficiently and copy-paste like a pro. Towards the end, we focus on network settings, Git hacks, and creating portable environments for development and production using Docker. Through this book, you will improve your terminal productivity by seeing how to use different tools.
Table of Contents (13 chapters)

Keyboard kung fu

Now that we have Vim all set up, it's time to learn some more command line shortcuts. The first thing we will be looking at is indentation.

Indentation can be done in Vim by going into visual mode and typing V for selecting portions of text or V for selecting full lines, followed by > or < to indent right or left. Afterwards press . to repeat the last operation:

Any operation can be undone by hitting u and can then be redone by hitting Ctrl + R (as in undo and redo). This is the equivalent of Ctrl + Z and Ctrl + Shift + Z in most popular editors.

When in visual mode, we have the option of changing the case of letters by hitting U to make all text upper case, u for lower case and ~ to reverse current case:

Other handy shortcuts are:

  • G: Go to end of file

  • gg: Go to start of file

  • Select all: This is not really a shortcut, but a combination of commands: gg V G, as in go to start of file, select full line, and move to the end.

Vim also has a handy shortcut for opening man pages...