Shell
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
[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 .
[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 .
[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