0% found this document useful (0 votes)
6 views2 pages

Shell

Uploaded by

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

Shell

Uploaded by

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

Shell

shell is program which gives CLI(command line interface)


EX.
sh
ksh
tcsh
bash
to varify current shell:- echo$ shell
[root@localhost]#echo $shell
/bin/bash
BASH (bourne again shell ) is a type of interpreter that processes shells
command .A shell interpreter takes commands in plain text format and call operating
system services to do something .base is the improved version of sh(bourne shell)

USING SHELL VARIABLES The Bash shell allows you to set shell variables that you can
use to help run commands or to modify the behavior of the shell. You can also
export shell variables as environment variables, which are automatically copied to
programs run from that shell when they start. You can use variables to help make it
easier to run a command with a long argument, or to apply a common setting to
commands run from that shell. Shell variables are unique to a particular shell
session. If you have two terminal windows open, or two independent login sessions
to the same remote server, you are running two shells. Each shell has its own set
of values for its shell variables

Command prompts
-linux command are case-sensitive
going forward we may need to perfom some admin activities as well. In such
cases we need to understand the prompt for executing commands.
-command prompt can help in determining whether you are a root(admin) user or a
normal user.
[root@localhost]# prompt for root user
[laksh@localhost]$ prompt for normal user
SYSTEM INFORMATION
to check whether the machine is a 32bit or 64 bit .
[root@localhost]# uname -i
to check architecture of cpu.
on the output if it shows i386/i586/i686

BASH FEATURES

BASH: Bourne again shell


-cat/etc/shells
1)command line completion:-
singal tab:- it will provide the best option.
Double tab:- it will provide all the possible option.
2)command line history :
1)history:- this command will display all the previous executed command .
2)history -c :- clear the commmand history.
3)!<number> :- it execute mentioned number command .
[root@localhost]# history
to check history.
[root@localhost]# !!
to check last command
[root@localhost]#!1
to check first command .

[root@localhost]# history –d 3
To delete 3rd command .
to check history.
[root@localhost]# !!
to check last command
[root@localhost]#!1
to check first command .

ABSOLUTE & RELATIVE PATH


absolute path is the exact address of the file in the file system.starting
from the root(/).

[root@localhost]#ll

Relative path writes it with repsect to another point in the file system.
[root@localhost]#mkdir prakshal

[root@localhost]# history –d 3
To delete 3rd command .
to check history.
[root@localhost]# !!
to check last command
[root@localhost]#!1
to check first command .

ABSOLUTE & RELATIVE PATH


absolute path is the exact address of the file in the file system.starting
from the root(/).

[root@localhost]#ll

Relative path writes it with repsect to another point in the file system.
[root@localhost]#mkdir prakshal

Relative path
[root@localhost]# mkdir test 1
Absulate path
[root@localhost]# mkdir baba /mnt

You might also like