0% found this document useful (0 votes)
18 views63 pages

Linux 141024063343 Conversion Gate01

The document provides an introduction to Linux, covering its history, architecture, and commands, as well as comparing it to Windows. It discusses the GNU project, the development of Linux by Linus Torvalds, and the various distributions available. Additionally, it highlights Linux's strengths, roles as a desktop and server OS, and includes basic command usage and file permissions.

Uploaded by

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

Linux 141024063343 Conversion Gate01

The document provides an introduction to Linux, covering its history, architecture, and commands, as well as comparing it to Windows. It discusses the GNU project, the development of Linux by Linus Torvalds, and the various distributions available. Additionally, it highlights Linux's strengths, roles as a desktop and server OS, and includes basic command usage and file permissions.

Uploaded by

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

Introduction to Linux

Objectives

• Introduction to linux
• Brief History of linux
• Architecture of linux
• Role of Linux
• Commands in linux
• Linux vs Windows
Before Linux
• In 80’s, Microsoft’s DOS was the dominated OS for
PC
• Apple MAC was better, but expensive
• UNIX was much better, but much, much more
expensive. Only for minicomputer for commercial
applications
• People was looking for a UNIX based system, which
is cheaper and can run on PC
• Both DOS, MAC and UNIX were proprietary, i.e.,
the source code of their kernel is protected
• No modification is possible without paying high
license fees
GNU Project
 Established in 1984 by Richard Stallman, who believes that software
should be free from restrictions against copying or modification in order to
make better and efficient computer programs.

GNU is a recursive acronym for “GNU's Not


Unix”
Aim at developing a complete Unix-like
operating system which is free for copying and
modification
Companies make their money by maintaining
and distributing the software, e.g. optimally
packaging the software with different tools
(Redhat, Slackware, Mandrake, SuSE, etc)
Stallman built the first free GNU C Compiler in
1991. But still, an OS was yet to be developed
Beginning of Linux
• A famous professor Andrew Tanenbaum developed Minix, a
simplified version of UNIX that runs on PC
• Minix is for class teaching only. No intention for commercial
use.
• In Sept 1991, Linus Torvalds, a second year student of
Computer Science at the University of Helsinki, developed the
preliminary kernel of Linux, known as Linux version 0.0.1.
• Soon more than a hundred people joined the Linux camp. Then
thousands. Then hundreds of thousands.
• It was licensed under GNU General Public License, thus
ensuring that the source codes will be free for all to copy, study
and to change.
Growing and growing…
In order to encourage wide
dissemination of his OS, Linus
made the source code open to
public. At the end of 1992 there
were about a hundred Linux
developers. Next year there were
1000. And the numbers
multiplied every year.

Linux: No of Users
Source: The Linux Counter

Recent estimates say about 29 million people use Linux worldwide. The effects of the
dot-com bust, IT slowdown and global economic recession can be clearly seen.
Linux Distributions
• Red Hat Linux : One of the original Linux distribution. The commercial, nonfree version is
Red Hat Enterprise Linux, which is aimed at big companies using Linux servers and
desktops in a big way. (NJIT)
• Free version: Fedora Project.

• Debian GNU/Linux : A free software distribution. Popular for use on servers. However,
Debian is not what many would consider a distribution for beginners, as it's not designed
with ease of use in mind.

• SuSE Linux : SuSE was recently purchased by Novell. This distribution is primarily
available for pay because it contains many commercial programs, although there's a
stripped-down free version that you can download.

• Mandrake Linux : Mandrake is perhaps strongest on the desktop. Originally based off of
Red Hat Linux.

• Gentoo Linux : Gentoo is a specialty distribution meant for programmers.


Architecture of Linux

• The Linux Kernel


• Shell
• System Utilities
• Application Programs

8
Components of Linux
• Kernel
The Linux kernel includes device driver support for a large number of PC hardware devices
(graphics cards, network cards, hard disks etc.), advanced processor and memory management
features, and support for many different types of filesystems (including DOS floppies and the
ISO9660 standard for CDROMs).

System Utilities
These system utilities are designed to be powerful tools that do a single task extremely well
(e.g. grep finds text inside files while wc counts the number of words, lines and bytes inside a
file). They are used in maintaining the file system, editing text files, managing running
processes, and installing new software packages.

• Application programs
Linux distributions typically come with several useful application programs as standard.
Examples include the emacs editor, xv (an image viewer), gcc (a C compiler),g++ (a C++
compiler), xfig (a drawing package), latex (a powerful typesetting language)
and soffice (StarOffice, which is an MS-Office style clone that can read and write Word, Excel
and PowerPoint files).
Linux Shells
• A shell is a command interpreter that allows you to type commands from the keyboard
to interact with the operating system kernel.

• Linux supports two forms of command input: through textual command line shells
similar to those found on most UNIX systems (e.g. sh - the Bourne shell, bash - the
Bourne again shell and csh - the C shell) and through graphical interfaces (GUIs) such
as the KDE and GNOME window managers.

• Various shells
 sh (Bourne Shell) The sh shell was the earliest shell, being developed for UNIX
back in the late 1970s.
 bash (Bourne-Again Shell) The bash shell is an improved version of the sh shell
and is one of the most popular shells today. It’s the default shell used by most Linux
distributions.
 csh (C Shell) The csh shell was originally developed for BSD UNIX. It uses a
syntax that is very similar to C programming.
 tsch The tsch shell is an improved version of the C Shell. It is the default shell used
on FreeBSD systems.
 zsh (Z Shell) The Z Shell is an improved version of the bash shell.

10
Strengths of Linux

• Stability
• Security
• Portablity
• Speed
• Cost
• Multiprocessing and other high-end features
• Applications
Roles of Linux
• Desktop
• Server
• Firewall
Linux on the Desktop
 First, there has been a historical lack of desktop
productivity applications available for Linux.
 The second issue is that the average user tends to find

Linux somewhat intimidating.


Linux as a Server
• File Server Using the Network File System (NFS) or
Samba service, Linux can be configured to provide
network storage of users’ files.
• Print Server Using the Common UNIX Printing System
(CUPS) and Samba services together, Linux can be
configured to provide shared printing for network users.
• Database Server Linux works great as a database server.
There are a variety of database services available for
Linux servers, including MySQL and PostgreSQL.
Linux as a Server..
• Web Server Linux is also widely deployed as a Web
server. The most popular Web service currently used on
Linux is the Apache Web server.
• E-Mail Server There are a variety of different e-mail
services available for Linux that can turn your system
into an enterprise-class e-mail server.
Linux as a Server..
• Linux is extremely stable. Simply put, a Linux server
rarely crashes. It just keeps running and running.Fast
• Linux servers are very fast. Many benchmark tests have
been run pitting Linux servers against other server
operating systems.
• Linux servers are much less expensive. Most other server
operating systems charge expensive per-seat licensing
fees, making them very expensive to deploy in large
networks.
Firewall
Linux Directory Structure
(root)
•Store drives
•Accessing data using folders
•Root directory- beginning of file
system
•When you log on the the Linux OS
using your username you are
automatically located in your home
directory.
Subdirectories inside root directory
• /bin : Important Linux commands available to the average user.
• /boot : The files necessary for the system to boot. Not all Linux
distributions use this one. Fedora does.
• /dev : All device drivers. Device drivers are the files that your Linux
system uses to talk to your hardware. For example, there's a file in
the /dev directory for your particular make and model of monitor, and
all of your Linux computer's communications with the monitor go
through that file.
• /etc : System configuration files.
• /home : Every user except root gets her own folder in here, named for
her login account. So, the user who logs in with “abc” has the
directory /home/abc, where all of her personal files are kept.
• /lib : System libraries. Libraries are just bunches of programming code
that the programs on your system use to get things done.
Subdirectories inside root directory
• /mnt : Mount points. When you temporarily load the contents of a CD-
ROM or USB drive, you typically use a special name under /mnt. For
example, many distributions (including Fedora) come, by default, with
the directory /mnt/cdrom, which is where your CD-ROM drive's contents
are made accessible.
• /root : The root user's home directory.
• /sbin : Essential commands that are only for the system administrator.
• /tmp : Temporary files and storage space. Don't put anything in here
that you want to keep. Most Linux distributions (including Fedora) are set
up to delete any file that's been in this directory longer than three days.
• /usr : Programs and data that can be shared across many systems and
don't need to be changed.
• /var : Data that changes constantly (log files that contain information
about what's happening on your system, data on its way to the printer, and
so on).
Command: pwd
 To find your current path use “pwd”
Command: cd
 To change to a specific directory use “cd”
Command: cd
 “~” is the location of your home directory
Command: cd
“..” is the location of the directory below current one
Command: ls
 To list the files in the current directory
use “ls”
Command: ls
• ls has many options
-l long list (displays lots of info)
-t sort by modification time
-S sort by size
-h list file sizes in human readable format
-r reverse the order
• “man ls” for more options
• Options can be combined: “ls -ltr”
Command: ls -ltr
 List files by time in reverse order with long
listing
General Syntax: *
 “*” can be used as a wildcard in unix/linux
Command: mkdir
 To create a new directory use “mkdir”
Command: rmdir
 To remove and empty directory use “rmdir”
Displaying a file
Various ways to display a file in Unix
• cat
• less
• head
• tail
Command: cat
• Dumps an entire file to standard output
• Good for displaying short, simple files
Command: less
• “less” displays a file, allowing forward/backward
movement within it
return scrolls forward one line, space one page
y scrolls back one line, b one page
• use “/” to search for a string
• Press q to quit
Command: head
• “head” displays the top part of a file
• By default it shows the first 10 lines
• -n option allows you to change that
• “head -n50 file.txt” displays the first 50 lines of file.txt
Command: head
 Here’s an example of using “head”:
Command: tail
 Same as head, but shows the last lines
File Commands
• Copying a file: cp
• Move or rename a file: mv
• Remove a file: rm
Command: cp
 To copy a file use “cp”
Command: mv
 To move a file to a different location use
“mv”
Command: mv
 mv can also be used to rename a file
Command: rm
 To remove a file use “rm”
Command: rm
 To remove a file “recursively”: rm –r
 Used to remove all files and directories
 Be very careful, deletions are permanent in Unix/Linux
File permissions
 Each file in Unix/Linux has an associated
permission level
 This allows the user to prevent others from

reading/writing/executing their files or


directories
 Use “ls -l filename” to find the permission

level of that file


Permission levels
• “r” means “read only” permission
• “w” means “write” permission
• “x” means “execute” permission
In case of directory, “x” grants permission to list directory
contents
File Permissions

User (you)
File Permissions

Group
File Permissions

“The World”
Command: chmod
If you own the file, you can change it’s permissions with
“chmod”
• Syntax: chmod [user/group/others/all]+[permission] [file(s)]
• Below we grant execute permission to all:
Running a program
• Make sure the program has executable permissions
• Use “./” to run the program
Running a program: an
example
 Running the sample perl script
“hello_world.pl”
Ending a program
 To end a program use “ctrl-c”. To try it:
Command: ps
 To view the processes that you’re running:
Command: kill
 To terminate a process use “kill”
Input/Output Redirection
(“piping”)
• Programs can output to other programs
• Called “piping”
• “program_a | program_b”
program_a’s output becomes program_b’s input
• “program_a > file.txt”
program_a’s output is written to a file called “file.txt”
• “program_a < input.txt”
program_a gets its input from a file called “input.txt”
A few examples of piping
A few examples of piping
Command: wc
• To count the characters, words, and lines in a file use
“wc”
• The first column in the output is lines, the second is
words, and the last is characters
A few examples of piping
Command: grep
 To search files in a directory for a specific
string use “grep”
Command: diff
• To compare to files for differences use “diff”
• Try: diff /dev/null hello.txt
• /dev/null is a special address -- it is always empty, and
anything moved there is deleted
Summary of commands
DOS Linux Description
cls clear Clear screen
copy cp Copying files
cd/chdir cd Change directory
del/erase rm Removing files
dir ls Listing of directories
rename mv Renaming a file
attrib chmod Change file permissions

tree ls -r List file recursively


assign ln Create file/directory
links
edit file.txt pico, vi Create or edit a file
backup tar To backup data
rd rmdir Removes directory
Linux vs. Windows
• Financial Differences
 Companies have to spend millions for licenses
for ever individual windows computer
 For Linux companies don’t have to spend
anything
• Technical Differences COST
 Keeping up to date by Upgrading LINUX WINDOWS
 Linux is Backward Compatible unlike
Windows Online Free Not Available
Downloads
• End-User Differences Retail Price, $50 $300
 No commercial word processor for Linux, CD
which matches the quality for Windows
 Windows is a Proprietary Technology:
Applications will only work on Windows
 Linux – Open Source
 NT – easy for non-programmer
 Linux – programmer-based culture
Conclusion
“When is it best to use Linux and when should some
other operating system be preferred?”
 It all depends on the user

You might also like