0% found this document useful (0 votes)
70 views7 pages

Kernal Shell: 1. / (Root) : 2. 1bin: 3. 1sbin: 4. /etc:-5. /usr

1. The document describes the directory structure of a UNIX file system. The root directory is represented by "/" and contains several sub-directories including /bin, /sbin, /etc, /usr, /home, /tmp, /dev, and /lib. 2. It also summarizes the purpose of each of the main sub-directories - for example, /bin contains executable files for commands, /etc contains system configuration files, and /home is used for user home directories. 3. The document then provides an overview of common UNIX shells like Bourne, Korn, C, and Bash shells and describes basic UNIX commands for navigating and managing the file system and performing tasks like creating/
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (0 votes)
70 views7 pages

Kernal Shell: 1. / (Root) : 2. 1bin: 3. 1sbin: 4. /etc:-5. /usr

1. The document describes the directory structure of a UNIX file system. The root directory is represented by "/" and contains several sub-directories including /bin, /sbin, /etc, /usr, /home, /tmp, /dev, and /lib. 2. It also summarizes the purpose of each of the main sub-directories - for example, /bin contains executable files for commands, /etc contains system configuration files, and /home is used for user home directories. 3. The document then provides an overview of common UNIX shells like Bourne, Korn, C, and Bash shells and describes basic UNIX commands for navigating and managing the file system and performing tasks like creating/
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 7

UNIX

Usr

Shell

Kernal

HW

/ (root)
/ (root)

1bin 1sbin 1etc 1usr 1home 1opt 1var 1lib 1tmp 1dev 1kernol

1. / (root) : This is root directory of the file system, the main directory of the entire file system, and
the root directory for the super user.
2. 1bin : bin stands for binary. This directory contains executable files for most of the unix
commands. This command used by normal user also.
3. 1sbin : This directory contains all system admin executable files (or) commands. This contains
programs used in booting the system and in system recovery.
4. /etc :- This directory contains all system configuration files and the files which maintain
information about users and groups. Ex. Ground Name, G.I.D, User Name, U.I.D.
5. /usr:- This is user name directory. Default directory provided by unix O.S. to create users home
directories and contains manual pages.
6. /tmp:- This directory contains all temporary files used by the Unix system. System on users
creates temporary files which will be removed when the server reboots.
7. /dev:- This directory contains all logical device files it maintains device for information’s
directory. Ex. All disks devices are in the subdirectory /dev/dsk.
8. /devices:- This directory contains physical devices files.
9. /home :- Default directory allocated for the home directory of normal users when the administrator
don’t specify any other directory. If your log name is root (or) sai, your default home
directory is /home/root (or) sai.
10. /Vas:- It directory all system log files and message files.
11. /lib:- This directory contains all the library functions. Provided by Unix programmers.
12. /kernel:- This directory contains platform independent loadable kernel modules required as part of
the boot process.
13. /mnt:- It contains entries for removable (mountable) media such as cd-roms and DLT Tapes.

Features of Shells :-
1. Shell is a interface between user and kernel.
2. Shell is a Command Checker.
3. Shell is an interpreter.
4. Shell built in “C” language.
5. Shell accept the user request and gettin them processed by the kernel.

SHELLS

Shell acts as an interface between user and the kernel. Shell is a command line interpreter and also it
talks as scripting language. The shell receives request from user and check command existers.
Types of Shells :- 5 Shells in Unix
1. Bourne Shell (Sh) :- It is default shell in Solaris operating system.
# sh → in this bourne shell.
#→ is the administrator prompt. $ is the normal user prompt.
→ No history of previous command.
→ No command line future.
2. Ksh (Korneshell) :- Ksh is default shell is AIX
→ Display history of previous commands
→ No command line feature.
3. Csh :- It gives the host name #
# is the administrator prompt, % for normal user prompt.
→ No history and no command line feature.
4. Zsh:- It gives the host name #
# is the administrator prompt, $ for normal user prompt display the
history and command line future.
5. bash :- (bourne again shell) It gives the version of the bash shell display the history &
command line future. Default shell in linux (history is 1-1000 commands disk)
# is the administrator prompt, $ is the normal user prompt.

Basic Commands:-
# PWD : It display the corned working directory ex: PWD ┘
# Logname : It display the current user name ex : logname ┘
# Clear : It clear the screen
# exit : To logout from current account.
# data : It display the current system data & time. Mon Mar 12 010:10:10 IST 2009
# who : It display the list of users who are currently logged in to the server. ie. Each user
logname, terminal No, date & time that the person logged in
# finger : It displays complete information about all the users who are logged in to the
users who are logged in to the server with more details.
# who am i : It displays current username, terminal no, data $ time at which you logged in the
system.
# cal : It display the previous month, current month and next month calendar.
# cal year : It display the given year calendar cdl 2009 it takes year from 1 to 9999
# cal month year : It display the given month, year cal only
# where is <command> : It display the location of the given command.
Ex : where is pwd ┘
# banner : It prints a message in large letters
ex : banner sai ┘
# init : To change the system run levels.
# init Ө : To shut down the system (ok boot prompt)
# init 1 : To bring the system to single user mode.
Without network, without GID (single user mode)
# init 2 : To bring the system to multi user mode with
no resource shared. (multi user mode) no files having
# init 3 : To bring the system multi user mode with source shared. (with sharing) multi
user
# init 5 : To gracfull power off the system.
# init 6 : To restart the (or) (reboot) the system.
# where is [option] command :
Options : -b → report binary files only
-m → report manual sections only
-s → report source files only
Creating Files : There are two commands to create files
Touch and Cat
Touch : It creates zero byte file size touch does allow you to store anything in a file. It is used
for to create several empty files quickly.
Ex : touch 1 2 3 4 5 
Cat : It is used for create a new file (or) to open a exitsted file (or) to append the data to the
file
Ex : # cat > file name 
- - - - - -- - - - -- > redirect input
------------------ >“ “ oupt put
Control + d {to close a file}
To open the file :
Ex : # cat > file name
(or)
Cat filename
To append the data to the file
Ex : # cat >> file name
-------
-------
Control + d
To Open the multiple flight file
Ex : # cat 1 2 3 4 
# cat 1 2 > 3
# cat [ options] [file]
Options :
-n → Precede each line with a line number.
-v → Display non-printing characters, except tabs, new – lines and form – feeds
-e → display $ at the end of each line (prior to new – line) ( when used with –v option)
Removing Files :
# rm : To remove the given file.
Sy:- # rm file name 
Options :
-i : it asks confirmation before deleting the file
Sy : # rm –i file name 
Remove file name ? y – it removes
N – it won’t remove
To remove the multiple files :
Sy : # rm file1 file2 file3 ……… it removes three files
# rm * → it removes all files in current directory.
Creating Directory :
# mkdir : [option] directory : it is used for to create a new directory
ex : mkdir /sai
Options :-
-p → create the parent directories as needed.
-m(mode) → `access permissions
Creating multiple directories
# mkdir sai sai1 sai2 
# mkdir -p /a1/a2/a3
Change Directory :
Sy:- # cd /directory name 
# cd /sai 
# pwd 
- /sai
# cd…. to change in to parent directory
# cd  to change to root directory.
Remove Directory :- A Directory need sto be empty before you can remove it. If it’s not, you need to
remove the files first also. You con’t remove a directory if it is your present working directory. You must
first change out of it.
Sy : - # rmdir /dirname  to delete a directory but directory should be empty.
Options:-
-r → it removes all files and sub directories, sub directory files including directory.
-i → it asks the conformation before deleting the directory.
Rename a file :- Rename a file with the move command “m”
# v (options) old file name new file name.
Options :-
-i → Interactive (prompt an wait for confirmation before proceeding)
-f → don’t prompt, even when copying over an existing target file (overrides – i)
cp :- To copy data one file to another file
sy :- #cp (options) old file name new file name
Options:-
-i → interactive (prompt and wait for confirmation before proceeding)
-r → recursively copy a directory
# cp 1 2 
# cp -1 2 
Overwrite 2 ?
Comparison of files : (cmp)
The cmp command compares two files, and (without options) reports the location of the first difference
between them. It can deal with both binary and ASCII file comparisons. It does a byte – by – byte
comparison.
# cmp (options) file 1 file2 
It comparies file 1 and file2. If both file contents are same number output if files are different
then it displays line number and character location.
Options :
-i → report on each difference
→s → report exit status only, not byte differences
# cmp 1 2  cat > 1 cat > 2
Char 4 lin 2 a a
b f
c c
d h
ˆd ˆd

Comm :- It choose common lines between 2 files


# comm. File1 file2 
Diff :- It display different lines between 2 files
# diff file 1  file 2 

You might also like