You are on page 1of 18

UNIX Part - I

Objectives
Unix History Why Unix ? Unix Features Unix Structure Unix Vs Windows Unix File system Unix Basic Commands Permissions - chmod Questions By:- Kunal Chhajed
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

UNIX History
In 1960’s Service Multics (Multiplexed Information and Computing

In 1970’s - the project was named Unics In 1973, Unix was rewritten in the C programming language AT&T made Unix available to universities and commercial firms

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Why Use UNIX
Multi-user - Support more than one user session, simultaneously, on the same system, at a time. Multiprogramming - Support more than one program, in memory, at a time. Multitasking - A single process can initiate multiple threads of execution. Exploiting concurrency in a process. Supports virtual memory, programs larger than the physical RAM of the system, can be executed.

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Unix features continued ...
Supports hierarchical file system to hold user data organized in the form of directories and files. Identifies a user with a userid and groupid and allows access permissions to resources to be specified using these ids. Supports a large number of tools, libraries and utilities to aid software development

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Unix Structure

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Unix Vs Windows
Unix is more flexible and can be installed on many different types of machines. - Unix is more stable and does not go down as often as Windows does, therefore requires less administration and maintenance. - Unix has greater built-in security and permissions features than Windows. - Unix possesses much greater processing power than Windows. - Unix is the leader in serving the Web. About 90% of the Internet relies on Unix operating systems running Apache, the world's most widely used Web server. - Software upgrades from Microsoft often require the user to purchase new or more hardware or prerequisite software. That is not the case with Unix. - The mostly free or inexpensive open-source operating systems
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Unix File system

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Typing UNIX Commands
ls – get directory listing ls –l – to view the permissions ls –F – tells which are directory ls –a – displays hidden files also mkdir – make directory cd – change directory rm – remove file rmdir – remove directory more – displays content of file date - displays current date cal - displays calendar
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Continued…
echo string – Echos arguments to the standard output cp <from_path> <to_path> – copy a file mv <from_path> <to_path> – move a file wc [filename]– count number bytes,words,lines in the file pwd – prints the full path name of the current directory kill [PIDs] – Terminate one or more process ID’s df – shows space available on the system du – shows up space used by folders

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Continued…
join file1 file2 cmp file1 file2 bc – simple mathematical calculations chsh – change your login shell clear – clear the terminal
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Continued…
info [options] – Documentation reader for commands Unix allows grouping of commands e.g pwd;date;cal passwd – create or change the password with associated user-name touch [filename] – create an empty file
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Continued…
ps – reports an active process w – print the summaries of system usage,currently logged in users and what they are doing. who – list the names of the users currently logged into the system whoami – print the user name based on the effective user ID which – shows the full path of the Shell commands uname – print the current unix system name

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Permissions
chmod – changes the permission of the file Syntax:chmod [mode] filename Permissions u - User who owns the file. g - Group that owns the file. o - Other. r - Read the file. w - Write or edit the file. x - Execute or run the file as a program
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Continued…
Numeric Permissions: chmod can also to attributed by using Numeric Permissions: 400 read by owner 040 read by group 004 read by anybody (other) 200 write by owner 020 write by group 002 write by anybody 100 execute by owner 010 execute by group 001 execute by anybody
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Continued…
for example, a common HTML file on a Unix server to be only viewed over the Internet would be: chmod 644 file.html Files such as scripts that need to be executed need more permissions. So common permission given to scripts. chmod 755 file.cgi

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

UNIX Book
A Student’s Guide to UNIX, Harley Hahn, McGraw-Hill, 1993. A Practical Guide to the UNIX System, Mark G. Sobell, Benjamin-Cummings, 3rd Edition, 1995. An Introduction to Berkeley UNIX, Paul Wang, Wadsworth, 1992.
© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

Thanks…!!!

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.

END

© Copyright 2002 - 2006 HSBC Software Development India Pvt. Ltd. All rights reserved.