Hello World in C

  1. First of all we need to install gcc: GNU Compiler Collection
  2. At the beginning, update the packages by typing
     apt-get update 
  3. Subsequently install the compiler by typing
     apt-get install gcc 
  4. Now create and open a .c file using nano editor
     nano hello.c 
  5. Type following code:
    hello.c
    #include <stdio.h> 
    int main() 
    {
    	printf("Hello World");
    	return 0; 
    }
  6. Save it using Ctrl + O (German keyboard: Strg + O)
  7. Exit using Ctrl + X (German keyboard: Strg + X)
  8. Compile the program using gcc
     gcc hello.c -o hello 
  9. Type
     ls -l 
  10. The created file has rights 644. Change it to 755
     chmod 755 hello 
  11. Type
     ./hello 

    to run the program

Hello World shell script

  1. Create and open file using nano editor
     nano helloBash 
  2. Type following code:
    helloBash
    #!/bin/bash
    echo "Hello World"
  3. Save it using Ctrl + O (German keyboard: Strg + O)
  4. Exit using Ctrl + X (German keyboard: Strg + X)
  5. Type
     ls -l 
  6. The created file has rights 644. Change it to 755
     chmod 755 helloBash 
  7. Type
     ./helloBash 

    to run the program

Hello World in Python

  1. First of all we need to install Python
  2. At the beginning, update the packages by typing
     apt-get update 
  3. Subsequently install Python by typing
     apt-get install python 
  4. Create and open a .py file using nano editor
     nano helloPt.py 
  5. Type following code:
    helloPt.py
     print "Hello World" 
  6. Save it using Ctrl + O (German keyboard: Strg + O)
  7. Exit using Ctrl + X (German keyboard: Strg + X)
  8. Run the program using
     python helloPt.py