• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

Introduction of Shell Scripting

{{postValue.id}}

SHELL SCRIPTING

INTRODUCTION OF SHELL

WHAT IS SHELL? A shell is a special program which acts as an interpreter between the user and the operating system. Shell accept human readable commands from a user and convert them into Kernel readable language. It is a command language interpreter that execute commands read from input devices such as keyboards or from files. The shell gets started when the user logs in or start the terminal.

Types Of Shell

There are Several types of shell are available. Some are

1.) Bourne shell The Bourne shell, called "sh," is one of the original shells, developed for Unix computers. some of the categories of bourne shells are listed below • Korn shell (ksh) • Bourne Again shell (bash)  It is the default shell on many Linux distributions • POSIX shell (sh)

2.) C shell

It was developed for a developer who has written C and C++ in Linux operating system.

some of the categories of C shells are listed below • C shell (csh) • TENEX/TOPS C shell (tcsh)

WHAT IS SHELL SCRIPT?

     Shell Script is a file which contains a series of Linux commands, Those commands are executed by the shell. It can combine lengthy and repetitive sequences of commands into a single and simple script, which can be stored and executed anytime. This reduces the efforts of the common user.

SHELL COMMANDS

ls, cd, cat, mkdir, cp, mv, for, while doing, etc…

SHABANG

#!/bin/bash

It is the first line should be present in every shell scripts. It’s called a shebang.

It represents the type of shell which we use to execute the script.

Example

List OF BASH SCRIPTS

[root@linuxhelp11 Desktop]# ll
total 12
-rwxr-xr-x 1 root root 24 Jul  1 19:31 bash.sh
-rwxr-xr-x 1 root root 22 Jul  1 19:51 csh.sh
-rwxr-xr-x 1 root root 22 Jul  1 19:33 zsh.sh

Content in each script

[root@linuxhelp11 Desktop]# cat bash.sh
#!/bin/bash
sleep 120
[root@linuxhelp11 Desktop]# cat csh.sh
#!/bin/csh
sleep 120
[root@linuxhelp11 Desktop]# cat zsh.sh
#!/bin/zsh
sleep 120

Execute script and check for SHELL using ps command

[root@linuxhelp11 Desktop]# ./bash.sh &
[7] 6158
[root@linuxhelp11 Desktop]# ps -fp 6158
UID         PID   PPID  C STIME TTY          TIME CMD
root       6158   5729  0 19:58 pts/1    00:00:00 /bin/bash ./bash.sh
[6]   Done                    ./bash.sh
[root@linuxhelp11 Desktop]#
[root@linuxhelp11 Desktop]# ./csh.sh &
[8] 6169
[root@linuxhelp11 Desktop]#
[root@linuxhelp11 Desktop]# ps -fp 6169
UID         PID   PPID  C STIME TTY          TIME CMD
root       6169   5729  0 19:58 pts/1    00:00:00 /bin/csh ./csh.sh

With this, the Introduction to Shell comes to an end.

Tags:
jackson
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is shell Scripting?

A

A shell is a special program which acts as an interpreter between the user and the operating system. Shell accept human readable commands from a user and convert them into Kernel readable language. It is a command language interpreter that execute commands read from input devices such as keyboards or from files.

Q

what is shell scripting?

A

A shell is a special program which acts as an interpreter between the user and the operating system. Shell accept human readable commands from a user and convert them into Kernel readable language. It is a command language interpreter that execute commands read from input devices such as keyboards or from files. The shell gets started when the user logs in or start the terminal.

Q

What is the use of shell scripting?

A

It's called a shell script because it combines into a "script" in a single file a sequence of commands that would otherwise have to be presented to the system from a keyboard one at a time. The shell is the operating system's command interpreter and the set of commands you use to communicate with the system.

Q

How to Execute script and check for SHELL?

A

Run the following commnad:
# ./bash.sh &

Q

Is Python a shell script?

A

Python has a very easy to read and understand syntax. Its style emphasizes minimalism and clean code while allowing the developer to write in a bare-bones style that suits shell scripting. Python is an interpreted language, meaning there is no compile stage.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luke ?
workbench for debian

I am using workbench in CentOS whereas now I need to use Debian Operating system so could you please help to install and use in Debian?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.