Download as pdf or txt
Download as pdf or txt
You are on page 1of 58

Introduction

Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

Programming Techniques
Free software, GNU/Linux and the Linux environment

Dr.Eng. Alin-Adrian ANTON


alin.anton@cs.upt.ro

February 21, 2013

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 1/35


Introduction
Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

Outline
1 Introduction
Lectures outline
Policies and logistics
Textbooks
Course objectives
2 Intellectual Property
What is software?
The four types of intellectual property
Digital piracy
3 Free Software. GNU/Linux
Free software
GNU Operating system
4 The GNU/Linux environment
The directory structure
Useful commands
Compiling a C program
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 2/35
Introduction
Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

Outline
1 Introduction
Lectures outline
Policies and logistics
Textbooks
Course objectives
2 Intellectual Property
What is software?
The four types of intellectual property
Digital piracy
3 Free Software. GNU/Linux
Free software
GNU Operating system
4 The GNU/Linux environment
The directory structure
Useful commands
Compiling a C program
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 2/35
Introduction
Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

Outline
1 Introduction
Lectures outline
Policies and logistics
Textbooks
Course objectives
2 Intellectual Property
What is software?
The four types of intellectual property
Digital piracy
3 Free Software. GNU/Linux
Free software
GNU Operating system
4 The GNU/Linux environment
The directory structure
Useful commands
Compiling a C program
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 2/35
Introduction
Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

Outline
1 Introduction
Lectures outline
Policies and logistics
Textbooks
Course objectives
2 Intellectual Property
What is software?
The four types of intellectual property
Digital piracy
3 Free Software. GNU/Linux
Free software
GNU Operating system
4 The GNU/Linux environment
The directory structure
Useful commands
Compiling a C program
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 2/35
Introduction
Lectures outline
Intellectual Property
Policies and logistics
Free Software. GNU/Linux
Textbooks
The GNU/Linux environment
Course objectives
References

Section 1

Introduction

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 3/35


Introduction
Lectures outline
Intellectual Property
Policies and logistics
Free Software. GNU/Linux
Textbooks
The GNU/Linux environment
Course objectives
References

Lectures outline I

1 GNU/Linux environment.
2 Structures, unions, bit fields. Command line arguments.
3 Function pointers.
4 Processing text files.
5 Processing binary files.
6 Stepwise Refinement. Large programs. The preprocessor.
7 NASA elements of style.

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 4/35


Introduction
Lectures outline
Intellectual Property
Policies and logistics
Free Software. GNU/Linux
Textbooks
The GNU/Linux environment
Course objectives
References

Lectures outline II

8 Recursion.
9 Greedy. Divide and Conquer.
10 Backtracking.
11 Singly linked lists.
12 Doubly linked lists.
13 Abstract data types.
14 Sorting.
This is only informative! The current structure is subject to
change!

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 5/35


Introduction
Lectures outline
Intellectual Property
Policies and logistics
Free Software. GNU/Linux
Textbooks
The GNU/Linux environment
Course objectives
References

Policies and logistics

Lectures:
interactive and challenging
Labs:
40% theoretical part (choice-based questionnaire)
60% individual programming
Final grade:
50% exam
40% labs
10% course activity
activity != lurking

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 6/35


Introduction
Lectures outline
Intellectual Property
Policies and logistics
Free Software. GNU/Linux
Textbooks
The GNU/Linux environment
Course objectives
References

Policies and logistics

Lectures:
interactive and challenging
Labs:
40% theoretical part (choice-based questionnaire)
60% individual programming
Final grade:
50% exam
40% labs
10% course activity
activity != lurking

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 6/35


Introduction
Lectures outline
Intellectual Property
Policies and logistics
Free Software. GNU/Linux
Textbooks
The GNU/Linux environment
Course objectives
References

Textbooks

1 Ciocarlie Horia, Ciocarlie Rodica, Tehnici de programare si


structuri de date, http://curs.algoritmi.ro/ (Romanian,
University library)
2 Samuel P. Harbison, Guy L. Steele Jr., C: A reference manual
http://careferencemanual.com/ (University library)

3 Kenneth A. Reek, Pointers on C


4 Alana, R. Feuer, The C Puzzle Book

5 Steven S. Skiena, The Algorithm Design Manual


6 Miguel A. Revilla, William B. Poucher, From Baylor to Baylor

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 7/35


Introduction
Lectures outline
Intellectual Property
Policies and logistics
Free Software. GNU/Linux
Textbooks
The GNU/Linux environment
Course objectives
References

Course objectives

These lectures will teach you how to:


master the C programming language at an advanced level
understand the fundamental problem-solving techniques for
programming
create art and beauty when you write programs!

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 8/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Section 2

Intellectual Property

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 9/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What is software?

Figure: Z31 at Konrad Zuses Home


Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 10/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What is software?

the software term was coined to describe the non-hardware


components of the computer, in particular the programs that
were needed to make the computers perform their intended
tasks (Rosen, 2003)

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 11/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

The four types of intellectual property

Laws are just like software: they are vast amounts of technical
texts with lots of patches, updates and version controlling
(Lindberg, 2008).

There are four types of intellectual property:


1 Copyrights
2 Trademarks
3 Trade secrets
4 Patents

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 12/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

The four types of intellectual property

Laws are just like software: they are vast amounts of technical
texts with lots of patches, updates and version controlling
(Lindberg, 2008).

There are four types of intellectual property:


1 Copyrights
2 Trademarks
3 Trade secrets
4 Patents

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 12/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

The four types of intellectual property


Lindberg (2008):
1 Copyrights are limitations on the expression of an idea. They
are designed to protect paintings, music, sculptures, dramatic
work, writing (including software), architectural drawings and
anything else that shows individual creative expression.
2 Trademarks protect the association of a provider of services
or goods with a picture, word, slogans, or a tune.
3 Trade secrets consist of information which derives value from
the fact of being secret (future product plans and market
strategies)
4 Patents are time-limited statutory monopolies designed to
protect inventions and technological developments in return of
full disclosure.
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 13/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

The four types of intellectual property


Lindberg (2008):
1 Copyrights are limitations on the expression of an idea. They
are designed to protect paintings, music, sculptures, dramatic
work, writing (including software), architectural drawings and
anything else that shows individual creative expression.
2 Trademarks protect the association of a provider of services
or goods with a picture, word, slogans, or a tune.
3 Trade secrets consist of information which derives value from
the fact of being secret (future product plans and market
strategies)
4 Patents are time-limited statutory monopolies designed to
protect inventions and technological developments in return of
full disclosure.
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 13/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

The four types of intellectual property


Lindberg (2008):
1 Copyrights are limitations on the expression of an idea. They
are designed to protect paintings, music, sculptures, dramatic
work, writing (including software), architectural drawings and
anything else that shows individual creative expression.
2 Trademarks protect the association of a provider of services
or goods with a picture, word, slogans, or a tune.
3 Trade secrets consist of information which derives value from
the fact of being secret (future product plans and market
strategies)
4 Patents are time-limited statutory monopolies designed to
protect inventions and technological developments in return of
full disclosure.
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 13/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

The four types of intellectual property


Lindberg (2008):
1 Copyrights are limitations on the expression of an idea. They
are designed to protect paintings, music, sculptures, dramatic
work, writing (including software), architectural drawings and
anything else that shows individual creative expression.
2 Trademarks protect the association of a provider of services
or goods with a picture, word, slogans, or a tune.
3 Trade secrets consist of information which derives value from
the fact of being secret (future product plans and market
strategies)
4 Patents are time-limited statutory monopolies designed to
protect inventions and technological developments in return of
full disclosure.
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 13/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Digital piracy

Copyright
You already learned how hard it is to debug programs. It is even
harder to plan and design them, and you already know how easy
they are to copy. So please do not copy software without giving
proper retribution to the owner.

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 14/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

What do you think?


Is it okay to scan books and magazines and post them on the
Internet?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 15/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it hard to write a book or publish a magazine?


maybe someone has already paid for it
the guy scanning it works pro bono, shares personal time and
resources and actually pays for the original
why pay the official distributor if the money does not reach
the real authors?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 16/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it hard to write a book or publish a magazine?


maybe someone has already paid for it
the guy scanning it works pro bono, shares personal time and
resources and actually pays for the original
why pay the official distributor if the money does not reach
the real authors?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 16/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it hard to write a book or publish a magazine?


maybe someone has already paid for it
the guy scanning it works pro bono, shares personal time and
resources and actually pays for the original
why pay the official distributor if the money does not reach
the real authors?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 16/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it hard to write a book or publish a magazine?


maybe someone has already paid for it
the guy scanning it works pro bono, shares personal time and
resources and actually pays for the original
why pay the official distributor if the money does not reach
the real authors?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 16/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Professional photoshop makeover

Be SMART!
Google for:
photoshop +
fails
photoshop +
(before and
after)

Image via www.afterphotoshop.com, accessed 20/02/2013 .

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 17/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Professional photoshop makeover

Be SMART!
Google for:
photoshop +
fails
photoshop +
(before and
after)

Image via www.afterphotoshop.com, accessed 20/02/2013 .

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 17/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Professional photoshop makeover

Be SMART!
Google for:
photoshop +
fails
photoshop +
(before and
after)

Image via www.afterphotoshop.com, accessed 20/02/2013 .

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 17/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Professional photoshop makeover

Professional photoshop makeover


The editor is doing hard work to make you pay for what you
see! Amazing, isnt it?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 18/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Professional photoshop makeover (again)

Surprised? Google
for:
photoshop +
fails
photoshop +
(before and
after)

Image via www.afterphotoshop.com, accessed 20/02/2013 .

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 19/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Professional photoshop makeover

Professional photoshop makeover


Hey, a movie has 25-30 frames per second!

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 20/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it okay to rip audio CDs and upload the MP3


files to the Internet?
how about sharing MP3 files with friends? (click
for video)
the quality of an audio CD is 10 times that of an
128Kbps MP3 file
is it okay to publicly distribute a text-only file of
the Winnetou novel ? is there any difference
between the text file and scanned PDF/DJVU
format?
what about a printed copy?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 21/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it okay to rip audio CDs and upload the MP3


files to the Internet?
how about sharing MP3 files with friends? (click
for video)
the quality of an audio CD is 10 times that of an
128Kbps MP3 file
is it okay to publicly distribute a text-only file of
the Winnetou novel ? is there any difference
between the text file and scanned PDF/DJVU
format?
what about a printed copy?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 21/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it okay to rip audio CDs and upload the MP3


files to the Internet?
how about sharing MP3 files with friends? (click
for video)
the quality of an audio CD is 10 times that of an
128Kbps MP3 file
is it okay to publicly distribute a text-only file of
the Winnetou novel ? is there any difference
between the text file and scanned PDF/DJVU
format?
what about a printed copy?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 21/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it okay to rip audio CDs and upload the MP3


files to the Internet?
how about sharing MP3 files with friends? (click
for video)
the quality of an audio CD is 10 times that of an
128Kbps MP3 file
is it okay to publicly distribute a text-only file of
the Winnetou novel ? is there any difference
between the text file and scanned PDF/DJVU
format?
what about a printed copy?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 21/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

is it okay to rip audio CDs and upload the MP3


files to the Internet?
how about sharing MP3 files with friends? (click
for video)
the quality of an audio CD is 10 times that of an
128Kbps MP3 file
is it okay to publicly distribute a text-only file of
the Winnetou novel ? is there any difference
between the text file and scanned PDF/DJVU
format?
what about a printed copy?

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 21/35


Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

would you buy the music if it wouldnt be available


for free?
can you afford to buy it?
do you buy DVDs and tickets to the movies you
like? do you also download them?
is it the same experience to watch a sloppy cam
recorded screener version of a movie as
compared to watching it at the cinema?
are you FREE to enjoy the product you already
paid for, or perhaps you are bound to consume it
in a very controlled fashion, which may include
watching commercials you dont want to?
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 22/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

would you buy the music if it wouldnt be available


for free?
can you afford to buy it?
do you buy DVDs and tickets to the movies you
like? do you also download them?
is it the same experience to watch a sloppy cam
recorded screener version of a movie as
compared to watching it at the cinema?
are you FREE to enjoy the product you already
paid for, or perhaps you are bound to consume it
in a very controlled fashion, which may include
watching commercials you dont want to?
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 22/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

would you buy the music if it wouldnt be available


for free?
can you afford to buy it?
do you buy DVDs and tickets to the movies you
like? do you also download them?
is it the same experience to watch a sloppy cam
recorded screener version of a movie as
compared to watching it at the cinema?
are you FREE to enjoy the product you already
paid for, or perhaps you are bound to consume it
in a very controlled fashion, which may include
watching commercials you dont want to?
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 22/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

would you buy the music if it wouldnt be available


for free?
can you afford to buy it?
do you buy DVDs and tickets to the movies you
like? do you also download them?
is it the same experience to watch a sloppy cam
recorded screener version of a movie as
compared to watching it at the cinema?
are you FREE to enjoy the product you already
paid for, or perhaps you are bound to consume it
in a very controlled fashion, which may include
watching commercials you dont want to?
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 22/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

What do you think?

would you buy the music if it wouldnt be available


for free?
can you afford to buy it?
do you buy DVDs and tickets to the movies you
like? do you also download them?
is it the same experience to watch a sloppy cam
recorded screener version of a movie as
compared to watching it at the cinema?
are you FREE to enjoy the product you already
paid for, or perhaps you are bound to consume it
in a very controlled fashion, which may include
watching commercials you dont want to?
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 22/35
Introduction
Intellectual Property What is software?
Free Software. GNU/Linux The four types of intellectual property
The GNU/Linux environment Digital piracy
References

Did you know?..

Patent absurdity
Did you know that someone attempted to issue a patent for the
mouse click and make everyone else pay for this idea?
Just like in politics, there are no silver bullets, and this remains
an open question! What do YOU think? Here are some interesting
links:
http://questioncopyright.org/
http://creativecommons.org/
http://patentabsurdity.com/

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 23/35


Introduction
Intellectual Property
Free software
Free Software. GNU/Linux
GNU Operating system
The GNU/Linux environment
References

Section 3

Free Software. GNU/Linux

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 24/35


Introduction
Intellectual Property
Free software
Free Software. GNU/Linux
GNU Operating system
The GNU/Linux environment
References

Free Software

FREE as in FREEdom (click for movie):


1 The freedom to run the program, for any purpose.
2 The freedom to study how the program works, and
change it so it does your computing as you wish.
3 The freedom to redistribute copies so you can help your
neighbour.
4 The freedom to distribute copies of your modified versions
to others.

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 25/35


Introduction
Intellectual Property
Free software
Free Software. GNU/Linux
GNU Operating system
The GNU/Linux environment
References

GNU Operating system

The GNU Project was launched in 1984 to develop the GNU


system. The name GNU is a recursive acronym for GNUs Not
Unix!. GNU is pronounced gnoo, as one syllable, like
saying grew but replacing the r with n.
A Unix-like operating system is a software collection of
applications, libraries, and developer tools, plus a program to
allocate resources and talk to the hardware, known as a kernel.
The Hurd, GNUs own kernel, is some way from being ready
for daily use. Thus, GNU is typically used today with a kernel
called Linux. This combination is the GNU/Linux
operating system. GNU/Linux is used by millions, though
many call it Linux by mistake.
Source: www.gnu.org
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 26/35
Introduction
Intellectual Property
Free software
Free Software. GNU/Linux
GNU Operating system
The GNU/Linux environment
References

GNU Operating system

The GNU Project was launched in 1984 to develop the GNU


system. The name GNU is a recursive acronym for GNUs Not
Unix!. GNU is pronounced gnoo, as one syllable, like
saying grew but replacing the r with n.
A Unix-like operating system is a software collection of
applications, libraries, and developer tools, plus a program to
allocate resources and talk to the hardware, known as a kernel.
The Hurd, GNUs own kernel, is some way from being ready
for daily use. Thus, GNU is typically used today with a kernel
called Linux. This combination is the GNU/Linux
operating system. GNU/Linux is used by millions, though
many call it Linux by mistake.
Source: www.gnu.org
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 26/35
Introduction
Intellectual Property
Free software
Free Software. GNU/Linux
GNU Operating system
The GNU/Linux environment
References

GNU Operating system

The GNU Project was launched in 1984 to develop the GNU


system. The name GNU is a recursive acronym for GNUs Not
Unix!. GNU is pronounced gnoo, as one syllable, like
saying grew but replacing the r with n.
A Unix-like operating system is a software collection of
applications, libraries, and developer tools, plus a program to
allocate resources and talk to the hardware, known as a kernel.
The Hurd, GNUs own kernel, is some way from being ready
for daily use. Thus, GNU is typically used today with a kernel
called Linux. This combination is the GNU/Linux
operating system. GNU/Linux is used by millions, though
many call it Linux by mistake.
Source: www.gnu.org
Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 26/35
Introduction
Intellectual Property
Free software
Free Software. GNU/Linux
GNU Operating system
The GNU/Linux environment
References

GNU Operating system

Open Source movement != Free Software movement


Open source is a development methodology; free software is a
social movement.
For the Open Source movement, non-free software is a
suboptimal solution; for the Free Software movement, non-free
software is a social problem and free software is the solution.
Source: www.gnu.org . A good read: Raymond (1999).

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 27/35


Introduction
Intellectual Property
Free software
Free Software. GNU/Linux
GNU Operating system
The GNU/Linux environment
References

Powered by GNU

Figure: G(G(GNUs not UNIX )NUs not UNIX)NUs not UNIX..

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 28/35


Introduction
Intellectual Property The directory structure
Free Software. GNU/Linux Useful commands
The GNU/Linux environment Compiling a C program
References

Section 4

The GNU/Linux environment

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 29/35


Introduction
Intellectual Property The directory structure
Free Software. GNU/Linux Useful commands
The GNU/Linux environment Compiling a C program
References

The GNU/Linux directory structure

/root superuser secret files


/usr contains user data
/usr/home personal home directories for the users
/home link to /usr/home
/home/student your home directory
/var mail data and databases
/lib software libraries
/tmp temporary files, may be deleted at boot

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 30/35


Introduction
Intellectual Property The directory structure
Free Software. GNU/Linux Useful commands
The GNU/Linux environment Compiling a C program
References

Useful commands

To check the manual pages, try man followed by command name:


pwd print working directory
ls list files and directory entries
mkdir make a new directory
rmdir remove directory
cp copy files and directories
mv move/rename and files
less view contents of a text file
See The Linux Documentation Project Guides, Introduction
to Linux - A Hands on Guide (http://www.tldp.org/).

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 31/35


Introduction
Intellectual Property The directory structure
Free Software. GNU/Linux Useful commands
The GNU/Linux environment Compiling a C program
References

Compiling a C program

To compile a C program using the GNU C Compiler:


gcc -Wall -o output executable filename.c

To run the program type:


./output executable or /path/to/output executable

The -Wall parameter is optional and instructs the compiler to print


all the warnings if any. The filename given via -o usually has no
extension. If the parameter is omitted, the compiled program will
be saved into ./a.out .

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 32/35


Introduction
Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

References I

Lindberg, V. (2008). Intellectual Property and Open Source: A


Practical Guide to Protecting Code. OReilly Media, Inc.
Raymond, E. S. (1999). The Cathedral and the Bazaar. OReilly &
Associates, Inc., Sebastopol, CA, USA, 1st edition.
Rosen, S. (2003). Software. In Encyclopedia of Computer Science,
pages 15991601. John Wiley and Sons Ltd., Chichester, UK.

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 33/35


Introduction
Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

Remember

Remember
It is hard to debug programs. It is even harder to plan and
design them, and you already know how easy they are to copy.
So please do not copy software without giving proper retribution
to the owner.

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 34/35


Introduction
Intellectual Property
Free Software. GNU/Linux
The GNU/Linux environment
References

Thank you

Thank You ! See you at


the labs.

Dr.Eng. Alin-Adrian ANTON Programming Techniques. GNU/Linux environment 35/35

You might also like