You are on page 1of 4

UNIX

What are the flavors of UNIX?


Red-hot - Linux
IBM – ibm.aix
Sun Microsystems – sun Solaris
Hp – HP-UX
Silicon graphics – IRIS
Microsoft – XENIX
Santa Cruz operations – sco-unix, digital- UNIX, bsd –UNIX

History of UNIX?

 Before 1960 there is no multi user o/s.


 Only DOS(single user o/s) plays vital role
 To over come this problem AT&T Bell labs people software team lead by Ken
Thomson, Dennis Ritchie and Rudd canday develop MULTICS
 They develop MULTICS o/s. But it allows only two users.
 In 1969, they developed UNICS(100 users) o/s
 But it has one draw back. It is in assembly language(machine dependent)
 In 1972 Dennis developed ‘c’ language for any plat form
 By using ‘c’ they develop UNIX in 1973 for multi user o/s

MULTICS – multiplex info computing system


UNICS – Uniplex info computing system

Process: Process is nothing but execution environment or running the program.


UNIX – process based o/s
Windows – thread based o/s

 UNIX o/s free from virus


 UNIX disk less o/s i.e. computer without hard disk is called dump terminal
 There is no down time for UNIX any 24*7 application. (I.e. atm, airtel, hutch,
services). We use UNIX servers
 For windows we have down time

Difference between scripting languages and programming languages?

Scripting programming
1. It is an interpreter language 1.it is compiler base language
2. Interpreter converts HLL to MLL 2.compiler converts HLL to MLL as a whole
Line by line program in one short.
3. It does not generate .exe file 3.it generates .exe file
4. No need to compile the prog 4.need to compile the program
5. No need to link with library files 5.it links with library files
6. It requires few lines of code 6.it requires numerous lines of code
7. It reduces devpt time 7.it increase the devpt time
Shell scripting:

 It supports 27 key words


 It is a sequence of UNIX commands and shell keywords
 Shell scripting is used for server side activities
 Shell scripts plays vital role in system administration, networking, database,
testing and development site
 Pl/sql means sql queries with procedural settings

UNIX COMMANDS:

# - system administrator prompt


$ - user working prompt

Basic commands:

$log name – it displays the current user name


$pwd – it displays the present working director (current working directory)
$clear – it clear the screen
$exit – to logout from current user
$date – it displays the system date and time
$who am I – it displays the current user information with more details
$who – it displays the information about all the users who have logged into the
system currently
$finger – more details given to compare with $who (who all r logged into the system)
$cal – it displays previous, current and next month calendar
$cal year – it displays the given year calendar
$cal month year – it displays the given month calendar only

1 .LS – list files and directories


Ls-l long list files and directories
Ls-a list with hidden files & directories
Ls-f list files and executable and link and normal files and directories
In Linux it list out with different colours
Ordinary files – white
Directory files – dark blue
Link –sky blue
Executable files – green
Zip files - red

2. Less file name: this command writes the content of a file onto the screen page at
at time.

3. Sleep (time): wait the specified time


4. Ctrl – c: if the UNIX not responding
5. Ctrl – d: save
6. Ctrl – z: if u there in vi editor and switch to command prompt
7. Wild card characters:

* - it matched ‘0’ or more characters


? – it matches any single character
[] – in given list, it matches any one character
- - it matches sequence
. – It matches single character except new line character

8. Locate: it is useful for finding files when you don’t know exactly where they are
stored, what they will be called.
$locate filename

Changing file permissions:

1. Chmod: to change file permissions and directory permissions


2. Chown: to change owner of a file
3. Chgrp: to change group

Filter commands:

1. Grep: it searches the pattern in a file

Grep – i to ignore uppercase and lower case distinctions


Grep – v to display those lines that do not match
Grep – n to display matching line with the line number
Grep – c print only the total count of matched lines
Grep – l it list outs only file names

2. Cut: it is used for to retrieve the required columns from the given file

3.sort: it is used to arrange the data.it arranges default based on ASCII values. The
default other is ascending order.
Sort-r it gives descending order
Sort-u it ignores duplicate files data
Sort –n numerical comparison

4.uniq:
Uniq-v it prints only non-duplicated lines
Uniq-d it prints only duplicated lines

5.Tr: it translate a char (or) to replace a character


6.cmp : it compares two files character by character
7.comm: it shows common lines between two files
8.pipe: pipe is an operator which is used for to combine more than one command
9.lpr: it is the command to take the print out from the unix

#init – to change system run levels


#init 0 – to shut down the system
#init 1 – to bring the system to single user mode
#init 2 – to bring the system to multiuser mode with no resource shared
#init 3 – to bring the system multi user moe with source share
#init 6 – halt and reboot the system
$banner “techno” – it prints a message in large letters

Creating files:
$touch file name – it creates zero bytes file size
$cat > file name – to create file
Ctrl+d – to close a file
$cat >>file name – to opened data into the file
$cat file1 file2 file3 file4 – redirect output
$cat <file name (or) $ cast file name – to open a file
$rm file name – it removes a file
$rm-i file name – it asks confirmation before deleting the file
$rm file1 file2 file3- it removes 3 files
$rm * - it removes all files in current directory
$mkdir directory name – to creates directory
$mkdir dir1, dir2, dir3…dirn – to create multiple directories
$cd directory name – to change directory
$cd.. – to change into parent directory
$cd\ - to change to root directory
$rmdir directory name – to delete a directory but directory should be empty
$rm-r directory name- it removes all files and subdirectories
$cp file1 file2 – this will copy the contents of file1 into file2
$cp – i file1file2 – if file2 is already existed then its asks the confirmation
$mv old file name new file name – to rename the file
$cmp file 1 file2 – to compare file1 and file2
$more file – display a file a page at a time

You might also like