You are on page 1of 12

Basra University College of science and Technology

Pharmacy department

COMPUTER SCIENCE

Title of Report :-
Linux
Students Names :
‫علي مكي عبد الحسن‬
‫محمد شاكر عبد الواحد‬
‫ظاهر حبيب عزيز‬
‫مصطفى حميد عطيه‬
‫يوسف جودت كاظم‬

Supervised by:
‫ نؤاس المنصوري‬: ‫أ‬

Introduction
Linux (also called GNU/Linux) is a free and open-source operating system.
Because of its development within the framework of the GNU Project, Linux
enjoys a high degree of freedom to modify, run, distribute and develop its parts.
Solaris FreeBSD. Linux is considered free software because being a free system
does not necessarily mean that it is a free system. Freedom has nothing to do with
the price. As the party that wants to provide the program is responsible for
providing the source code for the program and at the same time is free to sell and
determine the price of the version that it built.
Linux has a future because the idea behind Open-Source software is rather simple:
when programmers can read, distribute and change code, the code will mature.
People can adapt it, fix it, debug it, and they can do it at a speed that dwarfs the
performance of software developers at conventional companies. This software will
be more flexible and of a better quality than software that has been developed
using the conventional channels, because more people have tested it in more
different conditions than the closed software developer ever can. The Open-Source
initiative started to make this clear to the commercial world, and very slowly,
commercial vendors are starting to see the point. While lots of academics and
technical people have already been convinced for 20 years now that this is the way
to go, commercial vendors needed applications like the Internet to make them
realize they can profit from Open Source. Now Linux has grown past the stage
where it was almost exclusively an academic system, useful only to a handful of
people with a technical background.

1
Fig1. Linux in
Bird’s eye view

You should use Linux because it’s:

 Free and open-source.


 Powerful for research datacenters
 Personal for desktops and phones
 Universal

2
 Community (and business) driven.

Linux was made to keep on running:


As with UNIX, a Linux system expects to run without rebooting all the time. That
is why a lot of tasks are being executed at night or scheduled automatically for
other calm moments, resulting in higher availability during busier periods and a
more balanced use of the hardware. This property allows for Linux to be applicable
also in environments where people don't have the time or the possibility to control
their systems night and day.
Linux is secure and versatile:
The security model used in Linux is based on the UNIX idea of security, which is
known to be robust and of proven quality. But Linux is not only fit for use as a fort
against enemy attacks from the Internet: it will adapt equally to other situations,
utilizing the same high standards for security. Your development machine or
control station will be as secure as your firewall.
Linux is scalable:
From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds
of nodes: add or remove the appropriate packages and Linux fits all. You don't
need a supercomputer anymore, because you can use Linux to do big things using
the building blocks provided with the system. If you want to do little things, such
as making an operating system for an embedded processor or just recycling your
old 486, Linux will do that as well.
The Linux OS and most Linux applications have very short
debug-times:

3
Because Linux has been developed and tested by thousands of people, both errors
and people to fix them are usually found rather quickly. It sometimes happens that
there are only a couple of hours between discovery and fixing of a bug.

Linux Interaction: Shell, Prompt, Commands

1. The Shell:

 Program that interprets commands and sends them to the OS


 Provides:

○ Built-in commands

○ Programming control structures

○ Environment variables

 Linux supports multiple shells.

○ The default on SCC is Bash.

2. The “prompt”

4
( In Linux “ ~ ” is a shorthand for your home directory. )

3. Commands:

 Command: Command/program that does one thing


 Options: Change the way a command does that one thing

○ Short form: Single-dash and one letter e.g. ls -a

○ Long form: Double-dash and a word e.g. ls --all

 Argument: Provides the input/output that the command interacts with.

Commands: Hands-On Options;

 Commands have three parts; command, options and arguments/parameters.


Example: cal –j 3 1999. “cal” is the command, “-j” is an option (or switch),
“3” and “1999” are arguments/parameters.

5
Commands: Selected text processing utilities:
 awk Pattern scanning and processing language
 cat Display file(s)
 cut Extract selected fields of each line of a file
 diff Compare two files
 grep Search text for a pattern
 head Display the first part of files
 less Display files on a page-by-page basis

Command History and Command Line Editing:

 Try the history command


 Choose from the command history using the up ↑ and down ↓ arrows
 To redo your last command, try !!
 To go further back in the command history try !, then the number as shown
by history (e.g., !132). Or, !ls, for example, to match the most recent ‘ls’
command.
 What do the left ← and right → arrow do on the command line?
 Try the <Del> and <Backspace> keys

Help with Commands:

1. Type
o date –-help
o man date
o info date
2. BASH built-ins
o A little different from other commands
o Just type the command ‘help’

6
o Or ‘man bash’ Yes, you can always Google it.On using ‘man’ with
‘less’
3. The man command outputs to a pager called less, which supports
many ways of scrolling through text:
o Space, f # page forward
o b # page backward
o < # go to first line of file
o > # go to last line of file
o / # search forward (n to repeat)
o ? # search backward (N to repeat)
o h # display help
o q # quit help

The Linux File System:


The structure resembles an upside-down tree Directories (a.k.a. folders) are
collections of files and other directories. Every directory has a parent except for the
root directory. Many directories have subdirectories.

7
Navigating the File System:

 Essential navigation commands:

○ pwd print current directory

○ ls list files

○ cd change directory

We use pathnames to refer to files and directories in the Linux file system.

There are two types of pathnames:

1. Absolute – The full path to a directory or file; begins with /


2. Relative – A partial path that is relative to the current working directory;

does not begin with /

Examples:

 cd /usr/local Change directory to /usr/local/lib


 cd ~ Change to home directory (could just type ‘cd’)
 pwd Print working (current) directory
 cd .. Change directory to the “parent” directory
 cd / Change directory to the “root”
 ls –d pro* Listing of only the directories starting with “pro”

The ls Command:

● Useful options for the “ls” command:


○ ls -a List all files, including hidden files beginning with a “.”
○ ls -ld * List details about a directory and not its contents
○ ls -F Put an indicator character at the end of each name

8
○ ls –l Simple long listing

Symbolic links:

Sometimes it is helpful to be able to access a file from multiple locations within the
hierarchyOn a Windows system, we might create a “shortcut.” On a Linux system,
we can create a symbolic link:

 mkdir foo # make foo directory


 touch foo/bar # create empty file
 ln –s foo/bar . # create link in current dir.

“Finding a needle in a haystack”

The find command has a rather unfriendly syntax, but can be exceedingly

helpful for locating files in heavily nested directories. Examples:

 find ~ -name bu –type d # search for “bu” directories in ~


 find . –name my-file.txt # search for my-file.txt in .

Processes and Job Control:

As we interact with Linux, we create numbered instances of running programs


called “processes.” You can use the ‘ps’ command to see a listing of your
processes (and others!). To see a long listing, for example, of all processes on the
system try:

To see all the processes owned by you and other members of the class, try:

9
Editors:

Many Linux tools, such as grep and sed, use strings that describe
sequences of characters. These strings are called regular
expressions. Here are some examples:
 ^foo # line begins with “foo”
 bar$ # line ends with “bar”
 [0-9]\{3\} # 3-digit number
 .*a.*e.*i.*o.*u.* # words with vowels in order*

File Editors:

 gedit: Notepad-like editor with some programming features (e.g., syntax


highlighting). Requires X-Windows.

 nano: Lightweight editor. Non-Xwindows.

 emacs: Swiss-army knife, has modes for all major languages, and can be
customized. Formerly steep learning curve has been reduced with
introduction of menu and tool bars. Can be used under Xwindows or not.

 vim: A better version of ‘vi’ (an early full-screen editor). Very fast,
efficient. Steep learning curve. Popular among systems programmers.
Terminal or X-Windows.

10
Reference

[1] Linux Online (2008). "Linux Logos and Mascots". Archived from the
original

[2] "Operating Systems — Introduction to Information and Communication


Technology". Archived

[3] "Overview of the GNU System". Gnu.org. Archived

[4] Linus Benedict Torvalds (October 5, 1991). "Free minix-like kernel sources
for 386-AT". Newsgroup: comp.os.minix

[5] James, Daniel (February 2004). "Using Linux For Recording & Mastering".
Sound On Sound. SOS Publications Group. Archived

[6] Blanchette, Megan (July 7, 2015). "4 ways the Raspberry Pi is being used in
education". O'Reilly Radar. Archived

11

You might also like