01_Introduction to Linux

advertisement
Introduction to
Linux
Ubuntu for Libraries
Objectives
o To Understand the history of
Linux/Unix based OS’s
o To learn the various Linux
distributions
o To learn basic fundamental
Linux commands
History
The Linux kernel was originally
developed for the Intel 80386,
which was developed with
multitasking as one of its features.
The kernel is the lowest-level core
factor of the operating system.
The kernel is the code that
controls the interface between
user programs and hardware
devices, the scheduling of
processes to achieve multitasking,
and many other aspects of the
system.
History
•
•
•
Linus Torvalds, who was then a student at the
University of Helsinki in Finland, developed
Linux in 1991. It was released for free on the
Internet and generated the largest softwaredevelopment phenomena of all time.
Created by the Free Software Foundation, the
Free Software Foundation offers royalty-free
software to programmers and developers.
From 1991, Linux quickly developed on
hackers' web pages as the alternative to
Windows and the more expensive UNIX
systems.
Open source
•
•
•
•
Linux is legally covered by the GNU General Public License, also
known as GPL.
GPL allows people to take free software and distribute their own
versions of the software. However, the vendors who sell free
software cannot restrict the rights of users who purchase the
software. In other words, users who buy GPL software can make
copies of it and distribute it free of charge or for a fee.
Also, distributors of GPL software must make it clear that the
software is covered by the GPL and must provide the complete
source code for the software at no cost.
Linux embodies the Open Source model. Open source applies to
software for which the source code is freely available for anyone to
download, alter, and redistribute.
Distributions
• What is a distribution? Think of it as ice cream
flavours - each is unique but are generally
similar.
• Because Linux is open-sourced, there are
numerous distributions that programmers have
worked on, but the most popular are talked
about below.
Distributions
* Arch
Linux, a distribution based on the KISS principle with a rolling release system
* CentOS, a distribution derived from the same sources used by Red Hat, maintained by a
dedicated volunteer community of developers with both 100% Red Hat - compatible
versions and an upgraded version that is not always 100% upstream compatible
* Debian, a non-commercial distribution maintained by a volunteer developer community with
a strong commitment to free software principles
* Fedora which is a community distribution sponsored by Red Hat
* Gentoo, a distribution targeted at power users, known for its FreeBSD Ports-like automated
system for compiling applications from source code
* Knoppix, The first Live CD distribution to run completely from removable media without
installation to a hard disk. Derived from Debian
* Kubuntu, the KDE version of Ubuntu
* Linux Mint, a popular distribution based on and compatible with Ubuntu
* Mandriva, a Red Hat derivative popular in France and Brazil, today maintained by the
French company of the same name
* OpenGEU, derived from Ubuntu: The project's goal is to combine the power of GNOME
desktop with the eye-candy of Enlightenment 17.
* openSUSE, originally derived from Slackware, sponsored by the company Novell .
* PCLinuxOS, a derivative of Mandriva, grew from a group of packages into a popular,
community-spawned desktop distribution.
*Red Hat Enterprise Linux, which is a derivative of Fedora maintained and commercially
supported by Red Hat
* Ubuntu, a popular desktop distribution derived from Debian, maintained by Canonical
Why Ubuntu for this course
•
Since we are increasingly employing open systems based on open
standards, we have to eliminate any proprietary systems or
standards.
• Ubuntu is supported by a foundation and is also one of the
most popular Linux distributions which are based on open
source software.
• Ubuntu is committed to releasing a "long term support" (LTS)
version of the distribution every five years.
• The method of Ubuntu LTS releases allows us to plan for
upgrades.
• In addition, Ubuntu is derived from Debian, the original Linux
distribution.
• Debian is very stable, and has a very large community
supporting it.
• Most Linux distributions are based on open Unix standards.
Linux commands
•
Most commands operate like this:
$ command -options arguments
where command is the name of the command, -options is one or
more adjustments to the command's behaviour, and arguments is
one or more "things" upon which the command operates.
•
In the case of ls, we see that ls is the name of the
command, and that it can have one or more
options, such as -a and -l, and it can operate on
one or more files or directories.
Linux cheat sheet
ls : list directory contents
• If you want to see files/directories
•
•
•
•
ls
If you want to see hidden files/directories (beginning
with dot.), the use -a flag.
•
ls -a
cd : Change Directory
•
•
cd ../
cd /home/Desktop
Remember,
•
•
•
. represents the current directory
.. represents the parent directory
~ represents the home directory (of the user)
Linux cheat sheet
•
•
•
cp : Copy Files/Directories
•
•
cp movie_name.mp4 ~/Downloads/movies/
The above command will copy the movie_name.mp4 to the
specified directory.
mv : rename or move a file/directory
•
•
•
•
mv file1 ~/Downloads/Archive/
the above command will move the file from the current directory to
target directory.
mv logo_2.jpg new_logo.jpg
it will rename the file to new_logo.jpg.
cat : View File contents
•
cat install.log
Linux cheat sheet
•
•
•
•
pwd : print the current/working directory
• pwd
• /home/Desktop/scripts
mkdir : make/create directory.
• mkdir myfolder
rm : remove/delete file/directory
• rm useless.sh
• NOTE : it removes directories only if it’s empty, unless you specify -f
flag for force deletion.
sudo : superuser do, to gain root privilege
• sudo apt-get install gnome-shell
• Then enter your user account password, and you would be able to do
administrative tasks like root. So if you’re getting any permission error
using a command, then adding sudo as a prefix, might help.
Linux cheat sheet
•
•
•
man : A Reference manual for utils/commands/programs
•
•
e.g if you want to know more about rm command, then type man rm
wget : Download files from server
•
•
Wget or wget is very handy in downloading stuffs from internet,
over the command line.
wget url_of_the_content
gksudo : Run GUI Application with Root privilege
•
•
gksudo nautilus
The above command will open nautilus with root privilege. It’s
just like sudo, but in GUI mode.
Linux cheat sheet
•
•
apt-get : Command Line Tool for handling packages
Options:
•
•
•
•
•
install – To install package.
•
•
e.g Install the program MySQL database program
sudo apt-get install mysqlserver
remove – To remove package
•
sudo apt-get remove mysqlserver
update – To update the package cache
sudo apt-get update
add-apt-repository – To add a PPA (for your favorite
Application)
•
•
e.g add the PPA for the App Eidete (Screencasting program)
After, adding the PPA, apt-get update command is required.
Linux cheat sheet
•
•
shutdown : To shutdown the computer from terminal
•
•
shutdown -h
where time can be 0 if you want to shutdown now or specify the
exact time such as 10:30.
restart : Restart the computer
•
•
•
restart
Package Management
These are Ubuntu Specific commands. It Requires root privilege,
so just add the sudo prefix before each command (it will ask for
the user password and you’re done!).
Download