0% found this document useful (0 votes)
237 views

Linus

The document provides an overview of Linux and its history and architecture. It discusses the development of UNIX which inspired Linux. It also describes the key components of a Linux operating system including the kernel, userland, and graphical interface. Commonalities between Linux and UNIX are outlined.

Uploaded by

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

Linus

The document provides an overview of Linux and its history and architecture. It discusses the development of UNIX which inspired Linux. It also describes the key components of a Linux operating system including the kernel, userland, and graphical interface. Commonalities between Linux and UNIX are outlined.

Uploaded by

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

Department of computer Science and

Engineering

Linux and Server Administration

UNIT-1

Introduction : Unix and Linux, A brief history of UNIX, Architecture of the Linux operating system,
programming on Linux, advantages Linux System administrator- overview, role, duties of system
administrator, Linux vs. windows, system startup and shutdown ,Logging into (and out of) Linux
systems, Changing your password, General format of Linux commands, summary.

Cosc300Dp 1
UNIT-1

Introduction to Linux
Linux is a Unix-like computer operating system assembled under the
model of free and open source software development and distribution.
The defining component of Linux is the Linux kernel, an operating system
kernel first released 5 October 1991 by Linus Thorvaldsen.

Linux was originally developed as a free operating system for Intel


x86-based personal computers. It has since been ported to more
computer hardware platforms than any other operating system.
It is a leading operating system on servers and other big iron systems such as mainframe computers
and supercomputers more than 90% of today's 500 fastest supercomputers run some variant of Linux,
including the 10 fastest.
Linux also runs on embedded systems (devices where the
operating system is typically built into the firmware and highly
tailored to the system) such as mobile phones, tablet
computers, network routers, televisions and video game
consoles.
The Android system in wide use on mobile devices is built on
the Linux kernel.

Linux in Science (why?)


 Popular due to shared functional legacy with Unix systems associated
with research (Irix, SunOS/Solaris, etc.)
 Source code availability and semi-liberal licensing made it easy for
researchers to adjust the kernel as needed.
 Community backing and “perfect- storm” of enthusiasm for the
project led to critical mass of development (in contract to the BSD
family)
 Licensing and well known Unix-style APIs make it easy for vendors
of HPC equipment to write drivers for their hardware.
 Wide range of tools available for users (compilers, scientific libraries,
debuggers, etc).
 Performance, functionality and portability

History of Unix

The Unix operating system was conceived and implemented in


1969 at AT&T's Bell Laboratories in the United States by Ken
Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna.
It was first released in 1971 and was initially entirely written in
assembly language, a common practice at the time. Later, in a key
pioneering approach in 1973, Unix was re-written in the programming
language C by Dennis Ritchie (with exceptions to the kernel and
I/O).
The availability of an operating system written in a high-level
language allowed easier portability to different computer platforms.

Cosc300Dp 2
Today, Linux systems are used in every domain, from embedded systems to supercomputers,
and have secured a place in server installations often using the popular LAMP application stack. Use
of Linux distributions in home and enterprise desktops has been growing. They have also gained
popularity with various local and national governments.
A Linux-based system is a modular Unix-like operating system. It derives much of its basic
design from principles established in Unix during the 1970s and 1980s. Such a system uses a
monolithic kernel, the Linux kernel, which handles process control, networking, and peripheral and
file system access. Device drivers are either integrated directly with the kernel or added as modules
loaded while the system is running.
Separate projects that interface with the kernel provide much of the system's higher-level
functionality.
The GNU user land is an important part of most Linux-based systems, providing the
most common implementation of the C library, a popular shell, and many of the common
Unix tools which carry out many basic operating system tasks.
The graphical user interface (or GUI) used by most Linux systems is built on top of an implementation
of the X Window System.
What is X Windows?
X Windows is a public domain windowing system that is mainly used on UNIX systems. The
system includes a standard library of routines that can be used to develop GUI applications. Allows
applications to be displayed in windows and shared among different workstations and terminals

Development of UNIX was motivated due to


 The problems posed by the size and price of computers
 Additionally all the computers have different operating systems which was very difficult to
interoperate
This resulted in to be very difficult for users and system administrators
 As a result the Bell laboratories developed new operating system to address these problems.
 This new operating system was named as UNIX and it had these features
o Designed in a simple and elegant program design
o Written in the C programming language instead of in assembly code.
o Able to recycle code which now it is called the kernel (This kernel is the only piece of code
that needs to be adapted for every specific system and forms the base of the UNIX system).
 Once this operating system was developed
o It was easy for software developers to develop an operating system runs on different
varieties of hardware’s.
o It was easy to communicate between different types of hardwares
 During the next decades the development of UNIX was improved and It was able to support
hardware and software from different vendors.
 UNIX was initially found only in very large environments with mainframes and minicomputers.
 By the end of 80’s home computers were introduced and with this the UNIX operating system was
not efficient to work on these computers as a result people were shifting to use the current
windows family operating system.
Today the term “UNIX” is used to describe any operating system that conforms to the UNIX.
standards called “POSIX” – short for Portable Operating System Interface for UNIX.

Cosc300Dp 3
 It is designed to be:
o Portable
o Multitasking
o Multiuser
UNIX Operating System Names: A few popular names
1. HP-UX
2. IBM AIX
3. Sun Solairs
4. Mac OS X
5. IRIX
Linux Distribution Operating System) Names :A few popular names such as Redhat Enterprise
Linux, Fedora Linux,Debian Linux,Suse Enterprise Linux,Ubuntu Linux.

Common Things Between Linux & UNIX: Both share many common applications such as:

1. GUI, file, and windows managers (KDE, Gnome)


2. Shells (ksh, csh, bash)
3. Various office applications such as OpenOffice.org
4. Development tools (perl, php, python, GNU c/c++ compilers)
 Which distribution should we install?
o Prior to installation, the most important factor is your hardware.
 Since every Linux distribution contains the basic packages and can be built to
meet almost any requirement you only need to consider if the distribution will
run on your hardware.
 The hardware can be Linux PPC, Intel based(x86)
o Most Linux distributions offer a set of programs for generic PCs with special packages
containing optimized kernels for the x86 Intel based CPUs.
 These distributions are well-tested and maintained on a regular basis, focusing
on relevant server implementation and easy installation and update procedures.

Cosc300Dp 4
 Examples are Debian, Ubuntu, Fedora, SuSE and Mandriva, which are by far the
most popular Linux systems and generally considered easy to handle for the
beginning user, while not blocking professionals from getting the most out of
their Linux machines.
 Linux also runs decently on laptops and middle-range servers.
 Drivers for new hardware are included only after extensive testing, which adds
to the stability of a system.

Structure of a Linux Based Operating System


• A Linux based operating system is structured in much the same way as other operating systems
are structured.

Hardware
• This is the physical equipment of which your computer is composed; this includes things
like your keyboard and mouse, your video card and monitor, as well as your network
card, if you have one.
Kernel
• Operating system “kernel” is the core software used to “talk” to
computer hardware
• Is a core and modular system of drivers used to create a standardized
environment for interfacing with hardware
• Kernel operates in its own memory or “kernel-space”
• Responsible for allocating memory and time to system and user
processes as well as interacting with files.
• The Linux kernel acts as the interface between the hardware mentioned
above, and the rest of the operating system.
• The Linux kernel also contains device drivers, usually ones, which are
specific to the hardware peripherals that you are using.

Cosc300Dp 5
• The kernel is also responsible for handling things such as the allocation of resources (memory
and CPU time), as well as keeping track of which applications are busy with which files, as
well as security; and what each user is allowed to do on the operating system.
Shell
• On log-in, the system runs a shell
• A shell is the environment within which you will interface with the
kernel via
• commands
• It determines the syntax for complex command-line operations and
shell
• scripting
• The shell you’re using is called “bash,” the successor to the venerable
“Bourne Shell”
• called “sh”
• BASH: “Bourne Again SHell”
Various Shells
 sh – the original UNIX shell
 bash – written as a replacement/extension of sh
 csh – C shell based on the C programming language developed in the late
1970s
 tcsh – enhanced version of C shell
 ksh – Korn shell developed in the early 1980’s, backward compatible with
sh, but with some
 features of csh
 zsh – extended version of sh, developed in 1990
 dash – developed as replacement for ash in Debian

• Standard Library of Procedures


• A Linux based operating system will have a standard library of procedures, which
allows the user and software to communicate with the kernel. On most Linux based
operating systems, this library is often called "libc".
• Some examples may include calls to ask the kernel to open up a file for reading or
writing, or to display text on the display, or even read in keystrokes from the keyboard.
• Standard Utilities and User Applications
• A Linux based system will usually come with a set of standard Unix-like utilities; these
are usually simple commands that are used in day-to-day use of the operating system, as
well as specific user applications and services.
• How These All Work Together
• One of the benefits of Unix, and thus also of Linux, is the fact that it's designed to be a
multi-user and multi-tasking operating system

Cosc300Dp 6
• more than one user can be working on the same system at the same time - via different
consoles, pseudo and dumb terminals,
• The kernel divides up the time allotted to tasks; these are called "time slices".
• The kernel is responsible for running the tasks on the CPU, saving their state and
removing them, and then replacing them with the next task for its allocated "slice of
time".
• On machines with more than one CPU, a technique called Symmetric Multiprocessing
(SMP) is used to do the time slicing over multiple CPU's.
• Process Flow:
• When a user runs a standard utility or application, that software makes a call to the
kernel, via the standard library of procedures, requesting system resources, such as the
contents of files or the input being feed in via the keyboard.
• The kernel in turn then queries the actual hardware for this information, and then
returns it, again via the standard library of procedures layer.
• This layering is what provides the system with a level of stability. If your application
crashes for some reason, it is separated enough from the kernel to prevent it taking
down the whole system.

Programming on Linux

Most Linux distributions support dozens of programming languages. The original


development tools used for building both Linux applications and operating system programs are found
within the GNU tool chain, which includes the GNU Compiler Collection (GCC) and the GNU
build system. Amongst others, GCC provides compilers for Ada, C, C++, Java, and Fortran.
First released in 2003, the Low Level Virtual Machine project provides an alternative open-
source compiler for many languages. Proprietary compilers for Linux include the Intel C++
Compiler, Sun Studio, and IBM XL C/C++ Compiler. BASIC in the form of Visual Basic is supported
in such forms as Gambas, FreeBASIC, and XBasic.
Most distributions also include support for PHP, Perl, Ruby, Python and other dynamic
languages. While not as common, Linux also supports C# (via Mono), Vala, and Scheme. A
number of Java Virtual Machines and development kits run on Linux, including the original Sun
Microsystems JVM (HotSpot), and IBM's J2SE RE, as well as many open-source projects like
Kaffe and JikesRVM.

Linux Advantages

1. Low cost: You don’t need to spend time and money to obtain licenses since Linux and much of its
software come with the GNU General Public License. You can start to work immediately

Cosc300Dp 7
without worrying that your software may stop working anytime because the free trial version
expires. Additionally, there are large repositories from which you can freely download high quality
software for almost any task you can think of.
2. Stability: Linux doesn’t need to be rebooted periodically to maintain performance levels. It doesn’t
freeze up or slow down over time due to memory leaks and such. Continuous up-times of hundreds of
days (up to a year or more) are not uncommon.
3. Performance: Linux provides persistent high performance on workstations and on networks. It can
handle unusually large numbers of users simultaneously, and can make old computers sufficiently
responsive to be useful again.
4. Network friendliness: Linux was developed by a group of programmers over the Internet and has
therefore strong support for network functionality; client and server systems can be easily set up on
any computer running Linux. It can perform tasks such as network backups faster and more reliably
than alternative systems.
5. Flexibility: Linux can be used for high performance server applications, desktop applications,
and embedded systems. You can save disk space by only installing the components needed for
a particular use. You can restrict the use of specific computers by installing for example only
selected office applications instead of the whole suite.
6. Compatibility: It runs all common Unix software packages and can process all common file
formats.
7. Choice: The large number of Linux distributions gives you a choice. Each distribution is developed
and supported by a different organization. You can pick the one you like best; the core functionalities
are the same; most software runs on most distributions.
8. Fast and easy installation: Most Linux distributions come with user-friendly installation and
setup programs. Popular Linux distributions come with tools that make installation of additional
software very user friendly as well.
9. Full use of hard disk: Linux continues work well even when the hard disk is almost full.
10. Multitasking: Linux is designed to do many things at the same time; e.g., a large printing job in
the background won’t slow down your other work.
11. Security: Linux is one of the most secure operating systems. “Walls” and flexible file access
permission systems prevent access by unwanted visitors or viruses. Linux users have
to option to select and safely download software, free of charge, from online repositories
containing thousands of high quality packages. No purchase transactions requiring credit card
numbers or other sensitive personal information are necessary.
12. Open Source: If you develop software that requires knowledge or modification of the
operating system code, Linux’s source code is at your fingertips. Most Linux applications are Open
Source as well.

The difference between Linux and UNIX operating systems?

UNIX is copyrighted name only big companies are allowed to use the UNIX copyright and
name, so IBM AIX and Sun Solaris and HP-UX all are UNIX operating systems. The Open
Group holds the UNIX trademark in trust for the industry, and manages the UNIX trademark
licensing program.

 Most UNIX systems are commercial in nature.

Cosc300Dp 8
 Linux is a UNIX Clone

But if you consider Portable Operating System Interface (POSIX) standards then Linux can
be considered as UNIX. To quote from Official Linux kernel README file.
Linux is a Unix clone written from scratch by Linus Torvalds with assistance from a loosely-knit
team of hackers across the Net. It aims towards POSIX compliance.
However, "Open Group" do not approve of the construction "Unix-like", and consider it misuse of
their UNIX trademark.

 Linux is Just a Kernel


Linux is just a kernel. All Linux distributions includes GUI system + GNU utilities (such as cp,
mv, ls,date, bash etc) + installation & management tools + GNU c/c++ Compilers + Editors (vi)
+ and various applications (such as OpenOffice, Firefox). However, most UNIX operating
systems are considered as a complete operating system as everything come from a single source or
vendor.

 License and cost


Linux is Free (as in beer [freedom]). You can download it from the Internet or redistribute
it under GNU licenses. You will see the best community support for Linux. Most UNIX
like operating systems are not free (but this is changing fast, for example Open Solaris
UNIX).
However, some Linux distributions such as Redhat / Novell provides additional Linux support,
consultancy, bug fixing, and training for additional fees.
 User-Friendly
 Linux is considered as most user friendly UNIX like operating systems. It makes it easy to install
sound card, flash players, and other desktop goodies. However, Apple OS X is most
popular
 UNIX operating system for desktop usage.
 Security Firewall Software
Linux comes with open source netfilter/iptables based firewall tool to protect your server
and desktop from the crackers and hackers. UNIX operating systems comes with its own
firewall product (for example Solaris UNIX comes with ipfilter based firewall) or you need to
purchase a 3rd party software such as Checkpoint UNIX firewall.
 Backup and Recovery Software
UNIX and Linux comes with different set of tools for backing up data to tape and other backup
media. However, both of them share some common tools such as tar, dump/restore, and cpio etc.

File Systems

 Linux by default supports and use ext3 or ext4 file systems.


 UNIX comes with various file systems such as jfs, gpfs (AIX), jfs, gpfs (HP-UX), jfs, gpfs .

Fundamental differences between Linux and Windows

Windows is also multi-user, but limited user


It needs to shutdown
No free from virus.
To boot windows os 12 mb RAM is required.
Windows is process thread based concept

Cosc300Dp 9
For number os user it creates only one process.
It will effect to all other users.
Limited number of users increases in users loads to decrease in performance.
Windows is closed system
GUI-it is user friendly
Only one Microsoft Company.

Unix/Linux is a powerful operating system.


Multi-tasking
Multi-user: No limit for users
No need to shutdown
Free from virus.
To boot the unix os 2mb RAM is enough
UNIX is process based concept.
In UNIX every user request it creates new process.
Any user process is killed it will not effect the other user.
There is no limit for number of user working with the server.
UNIX is open system
UNIX is portable os
Unix provides programming facility
It is CUI
Unix is not a user friendly
Number of vendors i.e. Redhut , sun Microsoft, IBM, HP.
Unix is case sensitive.

System Administration Overview

If you ask ten system administrators what their job entails, you'll get ten different answers.
Linux system administration is a job that defines itself over the time you hold it, and redefines itself
over and over thereafter. In simple terms, the system administrator is the person responsible for
maintaining a computer system at peak efficiency. The analysis required to maintain the system makes
the job both challenging and rewarding. Users are the wildcards that make system administration
much more unpredictable than simple system maintenance. Changing user needs,changing security
environments, and changing applications, all conspire to change the system administrator's role over
time. Despite its changing nature, certain tasks confront all system administrators on all Linux
systems.

Your Role as a System Administrator

A system administrator aims to be as transparent to the user as possible. How much the users
need to contact you is a good indicator of how well you are doing your job. If you do your system
administration tasks well, users will seldom need to think of you at all, except to recruit you for the
company softball team or, of course, when they want additional services from the Linux system.

Cosc300Dp 10
Your workload will vary dramatically. You'll learn to cherish the lull times when there is little
external pressure, because they will enable you to work on projects to improve service and because
you'll know from experience that just around the corner something will happen that requires working
through the night or even several consecutive nights. If you spend the lull times evaluating your
system for potential security problems or areas where performance could be improved, you'll find that
there will be more low−pressure times as a result.

But what exactly is system administration? The term is so broad that no definition will give the
whole picture. A simple definition might be "the installation and maintenance of a computer system."

However, because a computer system might be anything from one computer to a networked
system containing hundreds of computers, and because each employer expects something different,
these few words don't define system administration in any strict sense. The real definition must
include the system administrator's role as the mediator between machine and user, since you are the
judge who decides whether problems are computer or user induced and the jury who determines what
should be done about it.

Tasks of a System Administrator

A better way to define system administration might be to develop a list of tasks performed by a system
administrator. This is not a comprehensive list, largely because every time we become comfortable
with our job descriptions, something else is added, but it is a fairly complete list of tasks you can
expect to perform as a Linux system administrator:

Configuring hardware•
Installing the operating system•
Installing application software•
Implementing system security•
Configuring the kernel•
Creating users and groups•
Updating software•
Performance tuning•
Disaster recovery•
Capacity planning•
Network administration

Cosc300Dp 11
Login Linux:

When you first connect to a Linux system, you usually see a prompt such as the following:

login:

To log in:
1. Have your userid (user identification) and password ready. Contact your system administrator if
you don't have these yet.

2. Type your userid at the login prompt, then press ENTER. Your userid is case-sensitive, so be sure
you type it exactly as your system administrator instructed.

3. Type your password at the password prompt, then press ENTER. Your password is also case-
sensitive.

4. If you provided correct userid and password then you would be allowed to enter into the system.
Read the information and messages that come up on the screen something as below.

login : bsr
amrood's password:
Last login: Sun Jun 14 09:32:32 2009 from 62.61.164.73
$

You would be provided with a command prompt ( some time called $ prompt ) where you would type
your all the commands. For example to check calendar you need to type cal command as follows:

$ cal
June 2009
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Change Password:
All Unix systems require passwords to help ensure that your files and data remain your own and that
the system itself is secure from hackers and crackers. Here are the steps to change your password:

1. To start, type passwd at command prompt as shown below.


2. Enter your old password the one you're currently using.

3. Type in your new password. Always keep your password complex enough so that no body can
guess it. But make sure, you remember it.

Cosc300Dp 12
4. You would need to verify the password by typing it again.

[bsr@localhost ~]passwd
Changing password for bsr
(current) Unix password:******
New UNIX password:*******
Retype new UNIX password:*******
passwd: all authentication tokens updated successfully
[bsr@localhost ~]
Note: I have put stars (*) just to show you the location where you would need to enter the current and
new passwords otherwise at your system, it would not show you any character when you would type.

Linux Command Basics

 Linux commands are case-sensitive


 ls is not the same as LS
 Linux commands may have options that come after the command that start with a “–” and
followed by a letter or “- -” and a word:

$ ls –r

$ ls --reverse

Linux commands may allow for arguments:

$ ls /scratch

 You can run more than one command on the same line by separating the commands with a
semicolon (;)

$ date; ls

 Most Linux commands have a manual page or help to describe how they can be used

$ man ls

Cosc300Dp 13
Who Are You?
While you're logged in to the system, you might be willing to know : Who am I?The easiest way to
find out "who you are" is to enter the whoami command:
[bsr@localhost ~]$ whoami
bsr
[bsr@localhost ~]$
Try it on your system. This command lists the account name associated with the current login. You can
try who I command as well to get information about yourself am.
Who is Logged In?
Sometime you might be interested to know who is logged in to the computer at the same time.

There are three commands are available to get you this information, based on how much you'd like to
learn about the other users: users, who, and w.
[bsr@localhost ~]$ users
bsr bsr
[bsr@localhost ~]$ who
bsr :0 Feb 11 00:31
bsr pts/1 Feb 11 00:32 (:0.0)
[bsr@localhost ~]$
Try w command on your system to check the output. This would list down few more information
associated with the users logged in the system.

Logging Out:
When you finish your session, you need to log out of the system to ensure that nobody else accesses
your files while masquerading as you.

To log out:
1. Just type logout command at command prompt, and the system will clean up everything and
break the connection
System Shutdown:
The most consistent way to shut down a Linux system properly via the command line is to use one of
the following commands:

Command Description
halt Brings the system down immediately.
Powers off the system using predefined scripts to synchronize and
init 0
clean up the system prior to shutdown
Reboots the system by shutting it down completely and then
init 6
bringing it completely back up
poweroff Shuts down the system by powering off.
reboot Reboots the system.
shutdown Shuts down the system.

Cosc300Dp 14
You typically need to be the superuser or root (the most privileged account on a Linux system) to shut
down the system, but on some standalone or personally owned Linux boxes, an administrative user and
sometimes regular users can do so.

Exercise #1: First commands

 Type “whoami”, press Enter – who are you?

 Type “pwd”, press Enter – where are you?

 Type “echo $HOME” – what does it show?

 Type “echo $USER” – what does it show?

 Type “echo $PWD” – what does it show?

Exercise #2: Log on a Linux machine or connect to one from a Windows machine. Enter your login

(user name) and password at relevant prompts. Enter these commands at the Linux prompt, and try

to interpret the output.

 echo hello world  date


 man ls  hostname
 man who  uname -a
 lost  uptime
 clear  who am i
 cal 2000  who
 cal 9 1752  id
 bc -l  last
 echo 5+4 | bc -l  finger
 yes please  w
 time sleep 5  top
 history  echo $SHELL
 passwd

*******The End8********

Cosc300Dp 15

You might also like