L7 Linux (1)
L7 Linux (1)
1
W.C. Deshapriya
Learning Outcomes
2
What is Linux ?
3
What is Linux ?
4
The Linux is free
• Anyone can download and compile the source code.
• The source code can be modified by anyone, and the modifications can
released to the public.
5
History of Linux
• Linus Torvalds is a Software engineer student at the University of Helsinki.
• He started to develop new OS similar to the MINIX,UNIX operating systems.
• As a result he develop Linux OS in 1990.
• He posted the first version of Linux OS on 1991.
6
Linux Today
• Linux has been used for many computing platforms in today
PC, PDA, Supercomputer,…
• Today Linux OS used on 7-10 million computers with 1000’s of
programmers.
• Now also developing and improving it.
7
The Kernel
Linux is not an Operating System
• Linux is a kernel
What is kernel ?
8
The Kernel
• A kernel is a program that allocates and controls hardware resources in a
system.
• Linux OS use the Linux kernel together with the GNU packages.
9
GNU packages
• GNU package is a collection of free software, ensuring that the source
codes will be free for copy, study and to change.
• It can be used as an operating system or parts of other operating systems.
Reference : https://directory.fsf.org/wiki/GNU
10
The Linux GNU package
Desktop applications
o Word processing (OpenOffice, Koffice)
o Programming (C, C++, Perl, Python, Java, PHP)
o Graphics (GIMP)
o Web browsers (Mozilla Firefox)
o Email (Evolution, Mozilla, KMail)
o Audio (amarok)
11
Linux Operating system
12
The Linux OS structure
Application User’s Interface AUI Applications: Compilers, word processors, X-based GUI
13
The Linux OS structure
AUI- Application User’s Interface:
• Interface between the kernel and user
• Allow user to make commands to the system
Kernel- The part of an OS where the real work is done (manage all)
14
Linux Operating system
15
Distributions of Linux
• The programmers can edit, modify, and redistribute the source code of Linux.
• The programmers improve the Linus and fix the bugs.
Finally created many Linux base operating systems.
• Ubuntu
• Lubuntu
• Fedora
• Linux Mint
• OpenSUSE
• Debian
• Sabayon
• Gentoo
• PCLinuxOS
16
Ubuntu
• Ubuntu is one of the Linux distributions available for public.
17
Linux File System
• Linux files are stored in a single rooted, as hierarchical file system.
• Data files are stored in directories (folders)
• Directories may be nested as deep as needed
root / directories
file
… dlun guest bin lib local
fd hd hd group passwd
18
Standard Files
Every LINUX system should contain a set of standard files and directories.
/ -The root directory - Top of the file system
/bin - Contain the binary (executable code) of Linux commands, e.g. bash, cat,
cp,ls, etc.
/boot - Contain all the files needed to boot the Linux system
/dev - Contain the special files for devices
/etc - Contain user files and directories
19
User Files
/home/davis - home directory of the user (name as davis)
/bin/bash - the location of the shell the user is using
/hom -Contain the home directories of every user in the system, e.g. dlun,
guest, etc
/lib -Store all essential libraries for different language compilers.
/lost+found -Contain all the files on the system not connected to any
directory.
20
Linux File Access Privilege
• Linux is a multiuser system, the files of all users are stored in a single root
directory.
• Administrator can give the access permission to each user to access or restrict
directories.
• The term “access permission” refers to
• read permission
• write permission
• execute permission
22
List the advantages and disadvantages of Linux
23
Linux Shell
• Shell interprets the command and request service from kernel
• Similar to DOS but DOS has only one set of interface while Linux can select
different shell
• Bourne Again shell (Bash), TC shell (Tcsh), Z shell (Zsh)
whoami
ls pwd
• Different shell has similar but different
Bash, Tcsh, Zsh
functionality.
• Bash is the default for Linux Kernel
• Graphical user interface of Linux is in fact an
application program work on the shell
26
Linux Shell
Online shell interface :
• https://copy.sh/v86/?profile=linux26&ref=itsfoss.com
• https://www.tutorialspoint.com/linux_terminal_online.php
27
Shell Command
Frequently used commands available in most shells:
• ls : to show the names of the file in the current directory
You can see all the hidden files by using the command “ls -a”.
• pwd: To know which directory you are in; use “pwd” to get path that
starts from the root.
• cd : change directory,
cd / change to the root directory
cd downloads -go to the downloads folder
cd .. change to the parent of that directory
cd~ My home directory
cd. The current directory
28
Shell Command
• touch : to create a new file. It can be anything, from an empty txt
file or an empty zip file.
touch abc.txt
29
Shell Command
• mv: to move files.
mv abc.txt xyz.txt
• rm : remove a file
rm abc.txt remove a abc.txt file
30
Shell Command
• man : ask for the manual (or help) of a command
man cd - ask for the manual of the command cd
• df: to see the available disk space in each of the partitions in your
system.
31
Shell Command
• zip, unzip: Use zip to compress files into a zip archive, and unzip to
extract files from a zip archive.
• rm : remove a file
rm abc.txt remove a abc.txt file
32
Shell Command
• top: top command will display a list of running processes and how
much use CPU in each process uses.
• hostname : show the name of your host/network. Adding a -i to the end will
display the IP address of your network.
33
Shell Command
34
Thanks!
35