Linux Introduction
05 September 2018
Abdullah Azizi
Baghlan University
Outline
1. Linux History
2. Linux Installation
3. Linux Distributions
4. Linux Fundamental Commands
2
Linux History…
▪ 1969:
▪ Dennis Ritchie and Ken Thompson developed the C language and the Unix
operating system at AT&T Bell Labs.
▪ They shared their source code with the rest of the world, including the
hippies in Berkeley California. By 1975, when AT&T started selling Unix
commercially, about half of the source code was written by others. The
hippies were not happy that a commercial company sold software that they
had written; the resulting (legal) battle ended in there being two versions of
Unix: the official AT&T Unix, and the free BSD Unix.
▪ 1980:
▪ Companies started developing their own Unix: IBM created AIX , Sun
SunOS(later Solaris), HP HP-UX and so on.
▪ And here is the first real root of Linux, when Richard Stallman aimed to end
this era of Unix separation and everybody re-inventing the wheel by starting
the GNU project (GNU is Not Unix). His goal was to make an operating
system that was freely available to everyone, and where everyone could
work together (like in the Seventies). Many of the command line tools that
you use today on Linux are GNU tools.
3
Linux History
▪ 1990:
▪ Linus Torvalds, a Swedish speaking Finnish student, buying a 386
computer and writing a brand new POSIX compliant kernel. He put the
source code online, thinking it would never support anything but 386
hardware. Many people embraced the combination of this kernel with
the GNU tools, and the rest, as they say, is history.
▪ 2015:
▪ More than 97 percent of the world's supercomputers, more
than 80 percent of all smartphones, many millions of
desktop computers, around 70 percent of all web servers, a
large chunk of tablet computers, and several appliances run
Linux.
▪ Linux kernel version 4.0 was released. Its source code grew
by several hundred thousand lines.
4
Introduction
▪ Linux is a fast and stable open source operating
system.
▪ It was developed in the early 1990s by Linus
Torvalds, along with other programmers around the
world.
▪ Distinguished by its power and flexibility, along with
being freely available.
▪ It is currently the system of choice for network
servers and workstations.
5
Introduction
▪ Linux generally divided into three major components:
1. Kernel is the core program that runs programs and manages
hardware devices, such as disks and printers.
2. Environment provides an interface for the user. It receives
commands from the user and sends those commands to the
kernel for execution.
3. File structure organizes the way files are stored on a storage
device, such as a disk.
▪ It distributed with a massive number of software
applications:
• Network servers
• Security
• Office applications
• Development tools
6
7
Linux Distributions
▪ One standard version of Linux, and several different
distributions.
▪ All distributions use this same kernel, although it
may be configured differently.
▪ Different companies and groups have packaged
Linux and Linux software in slightly different ways:
• RedHat
• Ubuntu
• Kubuntu
• Xubuntu
• Fedora
• Debian
• CentOS
8
Internet Servers
▪ One of the most important features of Linux is its
set of Internet clients and servers.
▪ Linux contains a full set of Internet clients and
servers, including mail, news, FTP, and web, as well
as proxy clients and servers.
9
Properties of Linux
▪ Linux is free
▪ Multitasking Capability
▪ Multiuser capability
▪ Portability
▪ Keeps on running
▪ Case-sensitivity
10
Linux Installation
▪ 4 types Linux installation:
▪ Normal Installation
▪ Multi-boot
▪ Virtualization
▪ Within Windows
11
Linux Installation…
▪ To install the OS, it is required to create the
following partitions for the purpose of better
control and management:
▪ Root (/)
▪ Home
▪ SwapArea
▪ User (user)
12
Command line structure
▪ The structure of the command line is a very
important thing to know for utilizing the operating
system:
13
Basic commands
Commands Short description
ls Displays a list of files in the current working directory
cd directory Changes directory (move to another directories)
more filename Shows file content
file filename Shows type of the file
passwd To change the logged in user password
man command To see the details about the command
man –k keyword Displays the list of commands which have the keyword named
as the argument in the description of that command
info command Displays information referred to specific command
command –help Displays a short description of a command and its usage
14
Manual pages Command
▪ Man pages also come in handy when you are using
multiple flavours of Unix or several Linux distributions
since options and parameters sometimes vary.
▪ man $command
▪ Type man followed by a command (for which you want
help) and start reading.
▪ man $configfile
▪ Most configuration files have their own manual. For
example: man syslog
▪ man -k (apropos)
▪ shows a list of man pages containing a string.
▪ example: apropos [Link]
15
Manual pages Command…
▪ whatis
▪ To see just the description of a manual page, use
whatis followed by a string.
▪ Examples:
▪ whatis route,
▪ Whatis ls
▪ whereis
▪ The location of a manpage can be revealed with
whereis.
▪ Examples:
▪ whereis route
▪ whereis ls
16
Working with Directories
▪ pwd (Print working directory)
▪ The tool displays your current directory.
▪ cd(change directory)
▪ Change the current directory with the cd command
(Change Directory).
▪ Examples:
▪ cd Desktop
▪ cd ..
▪ cd ./Samir
▪ cd ~
▪ cd -
17
Working with Directories…
▪ ls (List)
▪ List the contents of a directory.
▪ Examples:
▪ ls –l // long details about files
▪ ls –a // all files including hidden files
▪ mkdir (make directory)
▪ To create your own directories.
▪ Examples:
▪ mkdir Baseer
▪ mkdir Baseer Baheer
▪ mkdir “Baseer Baheer”
18
Working with Directories…
▪ rmdir (remove directory)
▪ To remove empty directory
▪ Examples:
▪ rmdir Baseer
▪ rmdir Baseer Baheer
▪ rmdir “Baseer Baheer”
▪ rmdir * // to remove all directories inside a certain directory
▪ Note: the option (-p) can be used with mkdir and rmdir to
create or remove the parent directories as well respectively.
19
Working with Files
▪ file
▪ The file utility determines the file type. Linux does not use
extensions to determine the file type.
▪ The command line does not care whether a file ends in
.txt or .pdf.
▪ Examples:
▪ file [Link]
▪ file [Link]
▪ touch
▪ One easy way to create an empty file is with touch.
▪ Examples:
▪ touch [Link]
▪ touch [Link] [Link] … // to create more files
20
Working with Files…
▪ rm (remove forever)
▪ The command line in general does not have a waste bin or trash, to
recover files.
▪ Examples:
▪ rm [Link]
▪ rm –i [Link]
▪ rm –rf xyz // to remove not an empty directory
▪ cp (copy one file)
▪ To copy a file, use cp with a source and a target
argument.
▪ Examples:
▪ cp [Link] [Link]
▪ cp [Link] ../[Link]
▪ cp [Link] [Link] ../dir1/
▪ cp –r mydirectory1 mydirectory2
▪ cp –i [Link]
21
Working with Files…
▪ mv (rename files with mv)
▪ Use mv to rename a file or to move the file to another
directory.
▪ Examples:
▪ mv [Link] path1
▪ mv [Link] [Link] [Link] .. path1
▪ mv [Link] [Link] // rename file1 to file2
▪ mv mydir1 mydir2 // rename directories: rename mydir1 to
mydir2
22
Script Command
▪ It is useful to be able to record what you have done
on the system.
▪ The word "script" in this context is short of the
word "transcript".
▪ It basically taking a picture of your screen as you do
a list of tasks.
% script file
// what you have done …
% exit
23
Tar Command
▪ To combine many files into a single file and split
back to its original files again.
1. % tar -cvf newfile firstfile secondfile thirdfile
….
2. % tar -tvf myfile
3. % tar -xvf myfile
24
Thank You
25