Skip to main content

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  gives the needed rights for all the users to execute this command. 

 sudo cp /usr/local/bin  copies 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 command you may find useful when you continue further with scripting.

 #!/bin/bash  a comment you need to put into a nano file while you are using python.
 nano .bashrc  with this command you are able to edit the script that will be executed always when the terminal is opened. For example you can add the command date to this file and every time you open the terminal the dated is showed.
 ./  will run your script in the current location.


Popular posts from this blog

Building Love-O-Meter by using a temperature sensor

This "Love-O-Meter" is based on the tutorial by Arduino and it comes with the starter kit. It uses a temperature sensor to measure the warmth of your skin and then starts to turn on (or off) the LEDs  indicated by the temperature.

The components Arduino UNOBreadboardJumper wiresLEDs220 ohm resistorsTMP36 temperature sensor

Building the Circuit
At first I ran the "Hello World" for Arduino to make sure the environment would work as expected. Now I could start to connect the jumper wires between Arduino UNO and the breadboard.

As usually I connected the breadboard to power (5V) and to the ground (GND). I inserted the TMP36 on the breadboard so the rounded part of the sensor would face away from Arduino.

I attached 3 LED lights and the resistors and connected them with Arduino. The lights should react to the heat of the finger and if the temperature would get hot enough all the lights would be on and would also tell you if you are a hot lover or not...

The result and the …

Creating a Bootable USB for Kali Linux

If you are interested to see my documentation about making a bootable USB for Xubuntu please click here!

This USB was made by using the latest version of Xubuntu (the 14.04 release).

Downloading Kali Linux 
23.13. After navigating to I chose the version that would suit me the best and started downloading the ISO image for 64-Bit system.

USB imaging
22.40. I followed the guide offered by and used the commandsudo fdisk -lwithout plugging the USB yet. I needed to pay attention to the path of Device Boot (/dev/sdb1). After this I inserted USB and ran the same command again. Now I could see how the name of Device Boot had changed to sdc1. This would be my USB to use.

22.50 It only took a while to format the dd code correctly as the base was already given on Kali's web page. After running the correct command for the first time I got an error message "'/dev/sdc1': Permission denied". In these kind of situations I tend to ask sudo for help an…

Concept Art: Cat food box

I enjoyed working with this project a lot!. My goal was to design a funny and distinguishable cat food box for an imaginary company. I got the inspiration from Japanese Maneki-neko. =^● ⋏ ●^=