Linux 141024063343 Conversion Gate01
Linux 141024063343 Conversion Gate01
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.
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.
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
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