← Shell Initiation

Header

In our journey we are in the point where we already know the terrain, now it time to start walking.

The fist tools you are going to use regularly are those for viewing files

But viewing it's not enough. Isn't? Our terminal can act like a complete word processor. We will find that there are lot of programs that can process text.

Sometimes this is just not enough and you need to do heavy regular expressions stuff. You will find two incredible tools for that:

Intact awk and sed have there own kind of language. With is not strange to find in Unix contents. There are other unix programs that have their own language (script language) that you can use directly from the terminal. Must of them you already know them if you have been doing web work:

Even more, all the commands we have seen can be put together inside a file with a specify header and be executed by the the same program that let you type commands on your terminal (bash):

The header will specify witch program will use to execute the script.

#!/bin/bash
# Proper header for a Bash script.

or

#!/usr/bin/python
# Proper header for a Python script.

or

#!/usr/bin/perl
# Proper header for a Python script.

Little by little you are getting how close are the internet and UNIX. Isn't? If you are interested on How to Programming Bash Scritps check this link of this other one

You will find that this scripts not only have IF and FOR statements that you can use also on your terminal directly, but also the possibility to mix commands by passing through them information. This are call pipes or redirections. That mean you can redirect the out put of one command to be the input of other one.

Terminal Dorkshop

To do this plumbing magic you use the following simbols:

You can found some amazing examples of very useful lines that involve redirection here

Another important duty you are going to do on your terminal will involve not just moving files from here to there but also compress them and package them. For that there are this tools.

There is one that's particularly powerful that let you pack and compress in different formats call tar for witch is worth it to do a

man tar

Speaking of power it's hard not to speak of two text editor that are SO incredible powerful that they can be use as IDEs and much more. This is the case of vi and emacs and the dived waters on their of developers choice. You can picture them as two doors to two different tribes. Choose wisely: