GNU Linux Fundamentals Presentation

51
GNU/Linux Fundamentals Installing & Using

description

GNU Linux Fundamentals is given in this presentation

Transcript of GNU Linux Fundamentals Presentation

Page 1: GNU Linux Fundamentals Presentation

GNU/Linux Fundamentals Installing & Using

Page 2: GNU Linux Fundamentals Presentation

Prepared by Yağız KaymakPrepared by Yağız Kaymak

[email protected]@ieu.edu.tr

Changes/additions & design changes Changes/additions & design changes by Dr. Enis Karaarslanby Dr. Enis Karaarslan

Page 3: GNU Linux Fundamentals Presentation

What is linux?What is linux?

Linux refers to the family of Unix-like Linux refers to the family of Unix-like computer operating systems using computer operating systems using the Linux kernel. the Linux kernel.

Linux can be installed on a wide Linux can be installed on a wide variety of computer hardware, variety of computer hardware, ranging from mobile phones, tablet ranging from mobile phones, tablet computers and video game consoles, computers and video game consoles, to mainframes and supercomputersto mainframes and supercomputers. .

Page 4: GNU Linux Fundamentals Presentation

Linux – Server OSLinux – Server OS

Linux is the leading server OS, Linux is the leading server OS, accounting for more than 50% of accounting for more than 50% of installationsinstallations and runs the top 10 and runs the top 10 fastest supercomputers in the world.fastest supercomputers in the world.

(http://en.wikipedia.org/wiki/Linux )(http://en.wikipedia.org/wiki/Linux )

Page 5: GNU Linux Fundamentals Presentation

Linux - DesktopLinux - Desktop

Desktop use of Linux has increased in Desktop use of Linux has increased in recent years, recent years, • partly owing to the popular Ubuntu, partly owing to the popular Ubuntu,

Fedora, and openSUSE distributionsFedora, and openSUSE distributions • the emergence of netbooks and the emergence of netbooks and

smartphones running an embedded smartphones running an embedded Linux.Linux.

Page 6: GNU Linux Fundamentals Presentation

Linux (cntd.)Linux (cntd.)

The name "Linux" comes from the The name "Linux" comes from the Linux kernel, originally written in Linux kernel, originally written in 1991 by Linus Torvalds. 1991 by Linus Torvalds.

The main supporting user space The main supporting user space system tools and libraries from the system tools and libraries from the GNU Project (announced in 1983 by GNU Project (announced in 1983 by Richard Stallman) are the basis for Richard Stallman) are the basis for the Free Software Foundation's the Free Software Foundation's preferred name GNU/Linux.preferred name GNU/Linux.

Page 7: GNU Linux Fundamentals Presentation

Linux (cntd.)Linux (cntd.) Linux is an Linux is an open sourceopen source operating system operating system

kernelkernel.. IIt is a complete, free, open, t is a complete, free, open, operating operating systemsystem..

It already belongs to you – It already belongs to you – GNU GNU GPLGPL(General (General Public License)Public License)

Although you can build a Linux system Although you can build a Linux system from from scratchscratch, you don't have to. There are , you don't have to. There are distributions that let you install and maintain a distributions that let you install and maintain a Linux system easily.Linux system easily.

Ubuntu, Pardus, Fedora, SuSE, Slackware and Ubuntu, Pardus, Fedora, SuSE, Slackware and Debian and hundreds more!Debian and hundreds more!

Page 8: GNU Linux Fundamentals Presentation

GNU

FREE SOFTWARE

OPEN SOURCE

KERNEL

Some ConceptsSome Concepts

Page 9: GNU Linux Fundamentals Presentation

GNUGNU

The GNU Project was launched in The GNU Project was launched in 1984 to develop a complete Unix-like 1984 to develop a complete Unix-like operating system which is free operating system which is free software—software which respects software—software which respects your freedom.your freedom.

The combination of GNU and Linux is The combination of GNU and Linux is the GNU/Linux operating system, now the GNU/Linux operating system, now used by millions and sometimes used by millions and sometimes incorrectly called simply “Linux”.incorrectly called simply “Linux”.

Page 10: GNU Linux Fundamentals Presentation

Unix-like OS, KernelUnix-like OS, Kernel

Unix-like operating systems are built Unix-like operating systems are built fromfrom::• a collection of applications, libraries, a collection of applications, libraries,

and developer tooland developer toolss• a program to allocate resources and talk a program to allocate resources and talk

to the hardware, known as a kernel.to the hardware, known as a kernel.

Page 11: GNU Linux Fundamentals Presentation

Free SoftwareFree Software

““Free software” is a matter of liberty, Free software” is a matter of liberty, not pricenot price

Think of free as in “free speach”Think of free as in “free speach”

Not as in “Free Beer”Not as in “Free Beer” Free means FreedomFree means Freedom

(http://www.gnu.org)(http://www.gnu.org)

Page 12: GNU Linux Fundamentals Presentation

Free Software (cntd.)Free Software (cntd.)

Free software is a matter of the Free software is a matter of the users' freedom to run, copy, users' freedom to run, copy, distribute, study, change and distribute, study, change and improve the software. improve the software.

More precisely, it refers to four kinds More precisely, it refers to four kinds of freedom, for the users of the of freedom, for the users of the softwaresoftware

Page 13: GNU Linux Fundamentals Presentation

Free software - Freedom Free software - Freedom

1.1. The freedom to run the program, for any The freedom to run the program, for any purpose .purpose .

2.2. The freedom to study how the program works, The freedom to study how the program works, and adapt it to your needsand adapt it to your needs..

3.3. The freedom to redistribute copies so you can The freedom to redistribute copies so you can help your neighbor.help your neighbor.

4.4. The freedom to improve the program, and The freedom to improve the program, and release your improvements to the public, so release your improvements to the public, so that the whole community benefitsthat the whole community benefits..

Page 14: GNU Linux Fundamentals Presentation

Open SourceOpen Source ““Free software” requires “open Free software” requires “open

source”source” All software has source code. Open All software has source code. Open

source software grants every user source software grants every user access to that code. access to that code.

Freedom means choice. Freedom means choice. Choice means powerChoice means power

Page 15: GNU Linux Fundamentals Presentation

Why Open SourceWhy Open Source

Customer BasedCustomer Based Bugs are found and fixed more Bugs are found and fixed more

quicklyquickly TTechnology revolution driven by echnology revolution driven by

market demand.market demand.

For details:For details:

http://www.redhat.com/about/whyopensourcehttp://www.redhat.com/about/whyopensource/ /

Page 16: GNU Linux Fundamentals Presentation

Open Source WorldOpen Source World

Page 17: GNU Linux Fundamentals Presentation

Why should I use Linux?

Linux is a UNIX variant – UNIX is everywhere and so is Linux.

Linux is rock solid – stable, fast and secure.

Servers, which have to run 24/7 and have to handle millions of requests run Linux.

It is highly likely that you'll sit in front of a Linux/Unix machine at least once in your career.

It is easy to learn and use.

Virus infection is difficult and rare …

Page 18: GNU Linux Fundamentals Presentation

Before we begin

Get rid of all your prejudices.

Do not expect it to work like Windows.

Do not hesitate to read manuals and documentations or to do a simple search on Google in case you have a problem.

Everyone can use it, so why can't you – it's not rocket science; and you are to-be-engineers in a ‘Department of Computer Computer EngineeringEngineering' – so no excuses!

Page 19: GNU Linux Fundamentals Presentation

Also...

Linux is an Operating System,

Perfect for learning fundamentals of OS

Modifying and testing the systems

Ready for Open Source Projects

You will be responsible and will be expected to expected to useuse it in many courses during your study.

Page 20: GNU Linux Fundamentals Presentation

Getting Linux

ftp.linux.org.tr

Page 21: GNU Linux Fundamentals Presentation

Live CD /USBLive CD /USB

Many distributions have Live versions Many distributions have Live versions where you can test using it without where you can test using it without installing.installing.

Just be sure that device priority is set Just be sure that device priority is set for CD or USB in BIOS.for CD or USB in BIOS.

Page 22: GNU Linux Fundamentals Presentation

Installing Linux

Simple.

Boot from the install CD.

You need space on your hard-diskA partition that will belong only to Linux, 10 GB

minimumA swap partition that will be used as extra RAM in

case you run out of it, around 1-2 GB.

A Linux install CD – Ubuntu, Pardus, etc.

You can get a copy from Internet

Page 23: GNU Linux Fundamentals Presentation

Very Important Tips

If you want to have more than one Operating system on your PC/laptop

Have a partition/space plan of your hard disk

First install Windows in one partition Then Linux in other partitions.

A Partition For root (/) A Partition For /home A Partition For swap

Page 24: GNU Linux Fundamentals Presentation

Very Important TipsVery Important Tips (cntd.) (cntd.) Make sure you manually partition the Make sure you manually partition the

hard-disk, most Linux installers use hard-disk, most Linux installers use the the whole diskwhole disk as the as the defaultdefault option. option.

Do Do NOTNOT use Turkish characters such use Turkish characters such as ğ,ı,ş in your usernames and as ğ,ı,ş in your usernames and passwords. passwords.

Linux is case sensitiveLinux is case sensitive Make sure you don't lose or forget Make sure you don't lose or forget

your password, unless you want to your password, unless you want to install again. install again.

Page 25: GNU Linux Fundamentals Presentation

Linux Desktop

Depending on your op. sys. choice, you'll likely to get one of the following desktop environments: GNOME (Ubuntu, Fedora, Centos …etc) or KDE (Kubuntu, Pardus …etc).

There are other desktop environments (XFCE, Window Maker, Fluxbox, IceWM etc.) But GNOME and KDE are the most popular.

Both of them will look familiar with a 'Start' menu, taskbar, system tray, icons on desktop, drag and drop etc.

Page 26: GNU Linux Fundamentals Presentation

A Screenshot (GNOME)

Page 27: GNU Linux Fundamentals Presentation

A Screenshot (KDE)

Page 28: GNU Linux Fundamentals Presentation

KDE 3D Desktop

Page 29: GNU Linux Fundamentals Presentation

Desktop Applications

You may be familiar with: Firefox, Thunderbird, OpenOffice, GIMP, Opera, Skype, CodeBlocks...

You may want to try: Amarok, Kopete, Pidgin, Kdevelop...

Java Applications run too: Eclipse, Netbeans, Limewire and many more I cannot remember now.

What if you need more applications?

Page 30: GNU Linux Fundamentals Presentation

Repositories

There are not many 'Next, next Wizards' to install applications on Linux.

Usually, every distro has a central repository, where applications can be searched and installed with one command.

For example, let's say you need kwrite for the Op. Sys. course; it is highly likely that it is already installed, but let's try to install it using the repository.

Page 31: GNU Linux Fundamentals Presentation

Repository Tips

Always search the repository first before you install an application. Do not bother going to their web-site and downloading.

Both Ubuntu and Pardus have huge repositories, this will save you time.

Don't bother going to the application's web site and download a package. Do not bother to compile from source.

Page 32: GNU Linux Fundamentals Presentation

Installing a packageYou can download a package(e.g. kwrite) using

CLI with apt-get install kwrite command,

Page 33: GNU Linux Fundamentals Presentation

Installing a package(cont.)

Or you can use package repository.

Page 34: GNU Linux Fundamentals Presentation

More Repository Tips

You can also remove and update a package via the repositories.

The operating system may prompt you to update your system when updates are available.

Other than the official repositories of the distro, you may add additional repositories for more applications.

Page 35: GNU Linux Fundamentals Presentation

Kernel, Shell, CommandsKernel, Shell, Commands

Page 36: GNU Linux Fundamentals Presentation

Shell is...

An interpreter. It can execute commands.

A programming language. It has control structures, loops, variables and NO pointers :)

Page 37: GNU Linux Fundamentals Presentation

GUI vs CLI

CLI = Command Line Interface

Shell: Bash, Sh, Csh, Zsh, etc...

Interface between the user and the OS

Page 38: GNU Linux Fundamentals Presentation

Hello Bash!

Page 39: GNU Linux Fundamentals Presentation

Users in Linux

Superuser (root)Normal users (example: yagiz)A normal user account is used for daily usage

of the system.Superuser account is reserved for system

administrationEvery user belongs to one or more groupsLinux is very strict about permissionsEvery file belongs to a user

Page 40: GNU Linux Fundamentals Presentation

Becoming 'root'

From time to time you may need to become the superuser; for installing applications, setting system settings etc.

The commands: su and sudo

When you are root, BE VERY CAREFUL! The system considers you know what you are doing and does not ask you 'if you are sure' – it just executes the command!

Page 41: GNU Linux Fundamentals Presentation

Directory StructureDirectory Structure

Directory Explanation

/ Root - Starting Point of Directory Structure

/etc Configuration Files

/bin /sbin Binaries (programs)

/home Personal Files

/var Variable data about system

/usr User Applications and alike

/tmp Temporary Files

/dev Devices

/mnt Mount Points

/proc Virtual directory, some info about kernel

Page 42: GNU Linux Fundamentals Presentation

FilesPermissions user Size Date-Time File Name-rw-r--r-- 1 yagiz 99039 2009-09-29 18:57 file_system.png

-rwxr-xr-x 1 yagiz 475 2009-09-29 18:42 gnome-terminal.desktop

-rw-r--r-- 1 yagiz 67702 2009-09-29 18:36 kwiret_inst_1.png

-rw-r--r-- 1 yagiz 99798 2009-09-29 18:37 kwrite_inst_2.png

Changing Permission Examples (details later)

$ chmod 655 dosyaAdi

$ chmod 777 dosyaAdi2

$ chmod -R 546 dizinVeIcindekiler

Page 43: GNU Linux Fundamentals Presentation

Basic OS Commands

Command Description

ls Lists files in a directory

cd Change Directory

cp Copies file(s)

mv Moves (Renames) files

mkdir Creates a directory

rm Removes files or folders

less Less is more

mc Midnight Commander

man Manuals

Page 44: GNU Linux Fundamentals Presentation

Learning More

Manuals – the man command gives you more information about a command.

Try:man lsman cp

Reading the manuals, you can learn about the parameters and other features of the commands.

Page 45: GNU Linux Fundamentals Presentation

Redirecting

You can redirect the output of a command to a file.

For example:ls -l > filesList.txt

The '>' directs the output to the file.

Page 46: GNU Linux Fundamentals Presentation

Pipe

Pipes let you use the output of a program as the input of another one!

Here are a few samples:

ls -l | less ps aux | grep firefox | less

Page 47: GNU Linux Fundamentals Presentation

More Linux Commands

Text editors: vi, vim, pico, nanoChanging your password: passwdPrint Working Directory: pwdWho are you?: whoamiWho is logged in now?: whoHow long has it been?: uptimeSystem information: unameListing the tasks, processes: top, psStop the processes!: kill, killall

Page 48: GNU Linux Fundamentals Presentation

More!

How much space?: du, df, freeFile contents: lessPrint on screen: echoPath of a command: whichRename command: aliasCompressing: tarLinks: lnCompiling: gcc, g++, javac

Page 49: GNU Linux Fundamentals Presentation

Compiling and running a C program in Linux

To compile a C program you must have a compiler like gcc or g++ (we will use gcc)

If you already have a compiler to compile a source code just type

gcc -o outputfile file1.c

To run the executable file type

./outputfile and press enter

Page 50: GNU Linux Fundamentals Presentation

A Few LinksPardus - http://www.pardus.org.tr/

Özgürlük İçin, Pardus http://www.ozgurlukicin.com/

Ubuntu - http://www.ubuntu.com/

Ubuntu Guide – http://www.ubuntuguide.org

LKD (Linux Kullanıcıları Derneği) http://www.linux.org.tr/

Linux Belgelendirme Grubu http://www.belgeler.org/

All Distros: Distrowatchhttp://distrowatch.com/

Page 51: GNU Linux Fundamentals Presentation