--- layout: page category-page: scripts category-title: Scripting tags: command base echo cat grep author: Dario Rasic title: Script Base Commands ---

Echo

This command print as output its entire argument on the command-line.
It could be used with variables, like in the following example:

example="this is an example"

echo $example
    this is an example

Cat

This command prints the content of a certain file as an output on the command-line.
As example, we could imagine a simple text file in nano named "Hello", which contains the line "Hello World".
So, our command example will look like this:
nano Hello
cat Hello
    Hello World

Grep

This one behaves very similarly to the previus one, but in this case it prints only the lines matching a certain pattern.
In this we could imagine a certain text file "animals", which contains a list of animal-names. If we want to select only the animals whose name begins with the letter "d", we will write this:
grep "D" animals
    Deer
    Dragon
    Dinosaur
    Dog
    Dolphin