• Introduction to linux 
• Brief History of linux 
• Architecture of linux 
• Role of Linux 
• Commands in linux 
• Linux vsWindows
• 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
 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
• 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.
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.
• 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.
• The Linux Kernel 
• Shell 
• System Utilities 
• Application Programs 
8
• 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).
• 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
• Stability 
• Security 
• Portablity 
• Speed 
• Cost 
• Multiprocessing and other high-end features 
• Applications
• Desktop 
• Server 
• Firewall
 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.
• 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.
• Web Server Linux is also widely deployed as a Web 
server. The most popular Web service currently used on 
Linux is the ApacheWeb 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 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.
(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.
• /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.
• /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).
 To find your current path use “pwd”
 To change to a specific directory use “cd”
 “~” is the location of your home directory
“..” is the location of the directory below current one
 To list the files in the current directory 
use “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”
 List files by time in reverse order with long 
listing
 “*” can be used as a wildcard in unix/linux
 To create a new directory use “mkdir”
 To remove and empty directory use “rmdir”
Various ways to display a file in Unix 
• cat 
• less 
• head 
• tail
• Dumps an entire file to standard output 
• Good for displaying short, simple files
• “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
• “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
 Here’s an example of using “head”:
 Same as head, but shows the last lines
• Copying a file: cp 
• Move or rename a file: mv 
• Remove a file: rm
 To copy a file use “cp”
 To move a file to a different location use 
“mv”
 mv can also be used to rename a file
 To remove a file use “rm”
 To remove a file “recursively”: rm –r 
 Used to remove all files and directories 
 Be very careful, deletions are permanent in Unix/Linux
 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
• “r” means “read only” permission 
• “w” means “write” permission 
• “x” means “execute” permission 
In case of directory, “x” grants permission to list directory 
contents
User (you)
Group
“The World”
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:
• Make sure the program has executable permissions 
• Use “./” to run the program
 Running the sample perl script 
“hello_world.pl”
 To end a program use “ctrl-c”. To try it:
 To view the processes that you’re running:
 To terminate a process use “kill”
• 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”
• 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
 To search files in a directory for a specific 
string use “grep”
• 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
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
COST 
LINUX WINDOWS 
Online 
Downloads 
Free Not Available 
Retail Price, 
CD 
$50 $300 
• 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 
 Keeping up to date by Upgrading 
 Linux is Backward Compatible unlike 
Windows 
• End-User Differences 
No commercial word processor for Linux, 
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
“When is it best to use Linux and when should some 
other operating system be preferred?” 
 It all depends on the user

Linux

  • 2.
    • Introduction tolinux • Brief History of linux • Architecture of linux • Role of Linux • Commands in linux • Linux vsWindows
  • 3.
    • 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
  • 4.
     Established in1984 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
  • 5.
    • A famousprofessor 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.
  • 6.
    In order toencourage 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.
  • 7.
    • Red HatLinux : 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.
  • 8.
    • The LinuxKernel • Shell • System Utilities • Application Programs 8
  • 9.
    • Kernel TheLinux 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).
  • 10.
    • A shellis 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
  • 11.
    • Stability •Security • Portablity • Speed • Cost • Multiprocessing and other high-end features • Applications
  • 12.
    • Desktop •Server • Firewall
  • 13.
     First, therehas 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.
  • 14.
    • File ServerUsing 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.
  • 15.
    • Web ServerLinux is also widely deployed as a Web server. The most popular Web service currently used on Linux is the ApacheWeb 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.
  • 16.
    • Linux isextremely 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.
  • 18.
    (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.
  • 19.
    • /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.
  • 20.
    • /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).
  • 21.
     To findyour current path use “pwd”
  • 22.
     To changeto a specific directory use “cd”
  • 23.
     “~” isthe location of your home directory
  • 24.
    “..” is thelocation of the directory below current one
  • 25.
     To listthe files in the current directory use “ls”
  • 26.
    • ls hasmany 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”
  • 27.
     List filesby time in reverse order with long listing
  • 28.
     “*” canbe used as a wildcard in unix/linux
  • 29.
     To createa new directory use “mkdir”
  • 30.
     To removeand empty directory use “rmdir”
  • 31.
    Various ways todisplay a file in Unix • cat • less • head • tail
  • 32.
    • Dumps anentire file to standard output • Good for displaying short, simple files
  • 33.
    • “less” displaysa 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
  • 34.
    • “head” displaysthe 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
  • 35.
     Here’s anexample of using “head”:
  • 36.
     Same ashead, but shows the last lines
  • 37.
    • Copying afile: cp • Move or rename a file: mv • Remove a file: rm
  • 38.
     To copya file use “cp”
  • 39.
     To movea file to a different location use “mv”
  • 40.
     mv canalso be used to rename a file
  • 41.
     To removea file use “rm”
  • 42.
     To removea file “recursively”: rm –r  Used to remove all files and directories  Be very careful, deletions are permanent in Unix/Linux
  • 43.
     Each filein 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
  • 44.
    • “r” means“read only” permission • “w” means “write” permission • “x” means “execute” permission In case of directory, “x” grants permission to list directory contents
  • 45.
  • 46.
  • 47.
  • 48.
    If you ownthe 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:
  • 49.
    • Make surethe program has executable permissions • Use “./” to run the program
  • 50.
     Running thesample perl script “hello_world.pl”
  • 51.
     To enda program use “ctrl-c”. To try it:
  • 52.
     To viewthe processes that you’re running:
  • 53.
     To terminatea process use “kill”
  • 54.
    • Programs canoutput 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”
  • 57.
    • To countthe 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
  • 59.
     To searchfiles in a directory for a specific string use “grep”
  • 60.
    • To compareto 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
  • 61.
    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
  • 62.
    COST LINUX WINDOWS Online Downloads Free Not Available Retail Price, CD $50 $300 • 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  Keeping up to date by Upgrading  Linux is Backward Compatible unlike Windows • End-User Differences No commercial word processor for Linux, 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
  • 63.
    “When is itbest to use Linux and when should some other operating system be preferred?”  It all depends on the user