Monday, January 31, 2011

Create shell commands

First of all, use gedit or other text editors to write shells. I will give a simple example for shell commands. Open gedit(or vi, kate , etc.) and write:
#! /bin/bash
echo "the best i am...."
then save it (save it to your users home directory /home/yourusername ) as "best". then chmod your best named file to 755 (chmod -R 755 best or sudo chmod -R 755 best)
open terminal and type ./best
the best i am  on screen will appear...
you can write complicated shell files and use it from terminal less usage of desktop items and desktop environment...
You can copy your file to /usr/bin directory using cp (sudo cp thisfile /thatdirectory)

No comments:

Post a Comment