How to start shell script writing

This is actually, I want to share, how I learned the shell scripting. It may be helpful for beginners. I am writing it step by step so that it will easy to understand:

STEP 1: Do your task manually & prepare the steps.

If you know the basic Linux commands, it will help you to write a shell script. I am not writing the basic Linux commands here, you can see check here you can Google it also.

Now you know some basic Linux commands.

Remember a thing that the commands you can also find in internet by googling or by searching in any other website. But it is important to remember the steps & logic of doing your task.

For example: If you need to copy some text files from one directory to other directory. Then divide your task in steps. Like:

1.       Create the directory where you want to copy your text files.

2.       Go to the directory where the text file exists.

3.       Copy the text files from that directory to new directory.

You need three commands there, first to create a new directory, second change your current directory & third copy text files to new directory. If you know the commands than good but if you don’t know then no need to worry, search it on Google, it will definitely give you required commands.

Ok, I am writing the commands here to complete above task:

1.       Create the directory where you want to copy your text files.

mkdir -p /home/rahul/newdir

keep reading in How to start shell script writing.


2 thoughts on “How to start shell script writing

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s