0% found this document useful (0 votes)
15 views4 pages

Practical 12

Uploaded by

omatalkar16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Practical 12

Uploaded by

omatalkar16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical 12

Experiment with different types of shells(e.g., Bash,Zsh) Explore shell commands.

Shell

If we are using Linux operating system, we are indirectly interacting


with the shell. While running Ubuntu, Linux Mint, or any other Linux
distribution, we are interacting with the shell by using the terminal.

A shell is a special user program that provides an interface for the user
to use operating system services. Shell accepts human-readable commands
from users and converts them into something which the kernel can understand.
It is a command language interpreter that executes commands read from input
devices such as keyboards or from files. The shell gets started when the user
logs in or starts the terminal.

Types of Shell

1.Bourne Shell (sh)

The Bourne shell was the first default shell on Linux systems, released in
1979. The shell program name is sh, and the traditional location is /bin/sh. The
prompt switches to $, while the root prompt is #.

The bourne shell is also known as ‘sh’ in short. Bourne is both a scripting
language and a command-line interface.

2. C Shell (csh)

The C shell (csh) is a Linux shell from the late 1970s whose main
objective was to improve interactive use and power the C language. Since the
Linux kernel is written in C, the shell aims to provide stylistic consistency
across the system.

The path to the C shell executable is /bin/csh. The prompt uses % for
regular users and # for the root user.

3. TENEX C Shell (tcsh)


The TENEX C shell (tcsh) is an extension of the C shell (csh) merged in
the early 1980s. The shell is backward compatible with csh, with additional
features and concepts borrowed from the TENEX OS.

4. KornShell (ksh)

The KornShell (ksh) is a Unix shell and language based on the Bourne
shell (sh) developed in the early 1980s. The location is in /bin/ksh or /bin/ksh93,
while the prompt is the same as the Bourne shell ($ for a user and # for root).

5. Bourne Again Shell (Bash)

The Bourne Again Shell is a Unix shell and command language created
as an extension of the Bourne shell (sh) in 1989. The shell program is the
default login shell for many Linux distributions..

The shell name shortens to bash, and the location is /bin/bash. Like the
Bourne shell, the bash prompt is $ for a regular user and # for root.

6. Z Shell (zsh)

The Z shell (zsh) is a Unix shell created as an extension for the Bourne
shell in the early 1990s. The feature-rich shell borrows ideas from ksh and tcsh
to create a well-built and usable alternative.

The executable location is in /bin/zsh. The prompt is user@hostname


location % for regular users and hostname# for the root user. The Z shell is the
default shell of Kali Linux

7. Friendly Interactive Shell (fish)

The Friendly Interactive Shell (fish) is a Unix shell released in the mid-
2000s with a focus on usability. The feature-rich shell does not require
additional configuration, which makes it user-friendly from the start.

The default executable path is /usr/bin/fish. The user prompt


is user@hostname location>, while the root prompt is root@hostname
location#.
Shell Commands
clear

The 'clear' command clears out all the previous commands and outputs from
terminal display.

pwd

The 'pwd' command stands for 'print working directory'. It doesn't accept any
option or argument and displays the detail of current working directory.

type

Linux 'type' command tell us whether a command given to the shell is a built-in
or external command.

Syntax:

type <command>

Example:

type pwd
type cd
type man
type cat
type file

which

Linux 'which' command locates the path of a command.

Syntax:

which <command1> <command2> <command3>....

Example:
which ls pwd rmdir mkdir cp cd file man

mkdir

Used to create a directory if not already exist. It accepts the directory name as
an input parameter.

Cp, mv, rmdir, ls etc. Are various shell commands.

You might also like