-->

Master Shell Scripting Commands From Beginner To Expert


Well guys in this tutorial we are going to discuss Shell Scripting and it's Examples.Let's discuss Basics of Shell Scripting in a Easy Way.
Shell is a mediator between User and Kernel.You might Found Kernel Version in Android.Where Same like Termux Shell contains list of commands to Interact with Computer.


There are different types of Shells K-shell,C-shell etc.Where shell is also a interpreter.But all Linux distributions uses bash shell developed by Gnu project. You can access Linux through a application calll
as Terminal which is Pre installed in all Linux distribution.

What's Special in shell Scripting

It's just a text file contains lot of commands can be executed one by one.These are mainly used in development of Systems Administration Services.By using this tool you can automate Linux tasks.
Also Read:What Is The Difference Between Shell, Console, And Terminal ?

Benefits of Shell Scripting


You can create Highly Powerful scripts with least code in less time.
Same like Cobol,Pascal Shell Scripting is a High level Programming language.but syntax is very easy to memorize.You can code full tasks with interactive debugging,Quick Start etc.
You can also Execute bash scripts on any Unix Operating system without doing any modifications.
You have Master up bash scripting to do all Linux functions
ALSO READ:You Can Own A Linux System By Holding Down Enter Key For 70 Seconds, Here’s The Fix

How to create and Execute Shell Scripting Commands

For we have to do 4 tasks
We have to
1) Create first bash script.
2)Now we have to Setup an executable permission on script.
3)Making Comments.
4)Learn Basic Syntax andShebang.
Let's go to the
Let's go to the topic
Open your favourite text editor notepad++, leafpad,gedit,bluefish. you can also use terminal based editors like vim or nano .

cope below code and paste it into your editor and save the file.

#!/bin/bash #This is the first bash scriptecho "Hello world this is kumarjeeru"

Let's learn all this code in detail
#!/bin/bash
It's the first line of code commonly known as shebang. This is the correct path to the bash interpreter.


 Bash interpreter is installed inside#!/bin/bash (bin) directory. You can also check all the executable on Linux type this command and hit enter ls /bin.
ALSO READ:20+ must know linux commands
Let's discuss second line of code
which starts with # means it is comment.This line is completely ignored by interpreter because Anything which starts with # doesn't show any result.it can be used to provide credits to that code . 


Where you can also use in html,css,xml,python,ruby or any other programming languages.If you see shebang there is an exclamation sign added after the # .So interpretercan recognize difference between path and comment.Which should have to get executed.

How to Setup executable permission on bash script

STEP1: Open your Linux terminal and type this command.
here i saved file with captainsmac name so replace this with yours.root@seven:~# chmod +captainsmac
such that above command will give execute permission to the owner and group. Now this file works running.
root@seven:~# ./captainsmac
Hurrah you created first Bash Script.


Next  Tutorialste Comming Soon Stay Tuned 


conclusion


I hope you may loved this cool post.If you have any doubts post in comment section.
Please check out advertisements on our website which helps us to post more content for you .
 Don't forget to share this cool post with all your friends and groupspread. HAVE  A  GREAT  DAY. 

Also Read

Post a Comment