Skip to main content


Showing posts from October, 2013

Quick tutorial - Shell script

This tutorial shows the very basics of how to make your own commands for Terminal, in other words shell scripts.

First we are going to create a simple nano file which is going to be the base for your script. This single file will contain all the information for your command.
nano /notice that .sh is not required but it clarifies things. Also remember to consider that some of the command names may already have taken.
In this case I will make a script that shows date and configuration of the computer. Write date and ifconfig and save the file.

This is not over yet though! You can't run your command without doing some actions first.
chmod +x  tellmesomething.shgives the needed rights for all the users to execute this command.

sudo cp /usr/local/bincopies your script into this location so you are able to run it.

Now you are able to run your very own script and it should look like this:

Now you know how to create a basic shell script. Here is some comma…