Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Introductory Linux Course

Uploaded by

azizzarb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Introductory Linux Course

Uploaded by

azizzarb
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Introductory Linux Course

1.What is Linux
Linus Torvalds developed Linux in 1991. It was intended to be a free version of UNIX for Intel
based PC platforms, and as such Linus released the source code to the computer community in
March of 1992. Since then, Linux has grown to become the collective work of thousands of
programmers worldwide, all of whom place their work under the GNU free usage license.
Linux system (fig.) is composed of three main parts of code: Kernel, system libraries, and
system utilities (management tasks: NW connection or login request from terminals).

2.Important features of Linux that make it so unique


• Full multitasking, allowing multiple users to run many programs on the same system at once.
• The X Window System is a very powerful graphics interface, supporting many applications.
• TCP/IP (Transmission Control Protocol/Internet Protocol) support.
• Virtual memory and shared libraries. Linux can use a portion of your hard drive as virtual
memory, expanding your total amount of available RAM. Linux utilizes all of your system's
memory, without memory limits or segmentation through the use of a virtual memory
manager. Linux also implements shared libraries, allowing programs that use standard
subroutines to find the code for these subroutines in the libraries at runtime. This saves a large
amount of space on your system; each application doesn't store its own copy of these common
routines.
• Much of the software available for Linux is free. In fact, a large number of utilities in Linux
are developed by the GNU project at the Free Software Foundation in Cambridge,
Massachusetts.
• Virtual memory support. Linux utilizes all of your system's memory, without memory limits
or segmentation through the use of a virtual memory manager.
• Built-in support for networking, multitasking, and other features. You'll see this touted as
"New Technology" in systems such as Windows NT. In fact, UNIX (and now, Linux) has
implemented this "new technology" for more than 15 years.
• Linux is cheaper to get than most commercially available UNIX systems If you have the
patience and access to the Internet, the only price you pay for Linux is your time. Linux is

1/6
Introductory Linux Course

freely available on the Internet. You can save yourself some time and get CD-ROM or floppy-
disk distributions from several commercial vendors.
• The most important advantage of using Linux is that you get to work with an honest-to-
goodness kernel. All of the kernel source code is available for Linux, and you have the ability
to modify it to suit your needs. Looking at the kernel code is an educational experience in
itself.
• Disadvantage
some of the hardware in your machine may not be supported by Linux. Again, your choices
are to either write the driver software yourself or get it from somewhere else. You have to
spend some time and effort managing your Linux machine.

Linux partitioning

There are two kinds of major partitions on a Linux system:


• data partition: normal Linux system data, including the root partition containing all the data
to start up and run the system; and
• Swap partition: expansion of the computer's physical memory, extra memory on hard disk.

Main Linux directories

2/6
Introductory Linux Course

The most important files and directories

1. The kernel
The kernel is the heart of the system. It manages the communication between the underlying
hardware and the peripherals. The kernel also makes sure that processes and daemons (server
processes) are started and stopped at the exact right times. The kernel has a lot of other important
tasks, so many that there is a special kernel-development mailing list on this subject only, where
huge amounts of information are shared. It would lead us too far to discuss the kernel in detail. For
now it suffices to know that the kernel is the most important file on the system.

2. The shell
What is a shell?
"A shell manages the interaction between the system and its users". A shell is much more than
that. A shell can best be compared with a way of talking to the computer, a language. Most users do
know that other language, the click-and-point language of the desktop. But in that language the user
is treated as a baby, asked to pick from what is presented to him.
The shell, on the other hand, is an advanced way of communicating with the system, because it
allows for conversation and taking initiative. Both partners in the communication are equal, so new
ideas can be tested.

Linux installation (Red hat)


• Setting up your hard disk
Linux prefers to have two partitions: one for the Linux swap space, and one for the Linux software
file system itself. The swap space is used as an extension of your machine's physical RAM and can
be quite small. The Linux file-system partition tends to be quite large, as it must hold all the Linux
software.
Hard disk drivers the first is: /dev/hda and the second /dev/hdb.
Ex: partition /dev/hda2 (the second primary partition on the first HDD)
• LILO boot loader
LILO (which means LInux LOader) is a bit tricky to use if you are not familiar with it and its
purpose. You need to install the LILO program, which changes the boot sector of your hard drive to
allow you to choose between a DOS and a Linux partition as the boot source partition.

Linux Login
On command line prompts the # character usually specifically indicates that you're logged in as
root, and the $ sign is used for regular user.

3/6
Introductory Linux Course

Linux Basic Commands


Command Example Description
cat Sends file contents to standard output. This is a way to list the
contents of short files to the screen. It works well with piping.
cat .bashrc Sends the contents of the ".bashrc" file to the screen.
cd Change directory
cd /home Change the current working directory to /home. The '/' indicates
relative to root, and no matter what directory you are in when
you execute this command, the directory will be changed to
"/home".
cd httpd Change the current working directory to httpd, relative to the
current location which is "/home". The full path of the new
working directory is "/home/httpd".
cd .. Move to the parent directory of the current directory. This
command will make the current working directory "/home.
cd ~ Move to the user's home directory which is "/home/username".
The '~' indicates the users home directory.
cp Copy files
cp myfile yourfile Copy the files "myfile" to the file "yourfile" in the current
working directory. This command will create the file "yourfile"
if it doesn't exist. It will normally overwrite it without warning
if it exists.
cp -i myfile yourfile With the "-i" option, if the file "yourfile" exists, you will be
prompted before it is overwritten.
cp -i /data/myfile . Copy the file "/data/myfile" to the current working directory and
name it "myfile". Prompt before overwriting the file.
cp -dpr srcdir destdir Copy all files from the directory "srcdir" to the directory
"destdir" preserving links (-p option), file attributes (-p option),
and copy recursively (-r option). With these options, a directory
and all it contents can be copied to another directory.
dd Disk duplicate. The man page says this command is to "Convert
dd if=/dev/hdb1 and copy a file", but although used by more advanced users, it
of=/backup/ can be a very handy command. The "if" means input file, "of"
means output file.
df Show the amount of disk space used on each mounted
filesystem.
less Similar to the more command, but the user can page up and
less textfile down through the file. The example displays the contents of
textfile.
ln Creates a symbolic link to a file.
ln -s test symlink Creates a symbolic link named symlink that points to the file
test Typing "ls -i test symlink" will show the two files are
different with different inodes. Typing "ls -l test symlink" will
show that symlink points to the file test.

4/6
Introductory Linux Course

locate A fast database driven file locator.


slocate -u This command builds the slocate database. It will take several
minutes to complete this command. This command must be
used before searching for files, however cron runs this
command periodically on most systems.
locate whereis Lists all files whose names contain the string "whereis".
logout Logs the current user off the system.
ls List files
ls List files in the current working directory except those starting
with. And only show the file name.
ls -al List all files in the current working directory in long listing
format showing permissions, ownership, size, and time and date
stamp
more Allows file contents or piped output to be sent to the screen one
page at a time.
more /etc/profile Lists the contents of the "/etc/profile" file to the screen one page
at a time.
ls -al |more Performs a directory listing of all files and pipes the output of
the listing through more. If the directory listing is longer than a
page, it will be listed one page at a time.
mv Move or rename files
mv -i myfile yourfile Move the file from "myfile" to "yourfile". This effectively
changes the name of "myfile" to "yourfile".
mv -i /data/myfile . Move the file from "myfile" from the directory "/data" to the
current working directory.
pwd Show the name of the current working directory
more /etc/profile Lists the contents of the "/etc/profile" file to the screen one page
at a time.
shutdown Shuts the system down.
shutdown -h now Shuts the system down to halt immediately.
shutdown -r now Shuts the system down immediately and the system reboots.
whereis Show where the binary, source and manual page files are for a
command
whereis ls Locates binaries and manual pages for the ls command.

5/6
Introductory Linux Course

Directory commands
cd - Change the working directory
find - Find a file by name or by other characteristics
mkdir - Make a directory
rmdir - Remove a directory

File manipulation commands


cat - Concatenate and display a file
chmod - Change the permissions mode of a file
chown - Change the owner and/or group of a file
cp - Copy a file
diff - Display differences between pairs of text files
grep - Search a file for a specific text string
mv - Move or rename a file
rm - Remove a file

Display commands
date - Print the date and time
finger - Display information about a user
head - Display the first few lines of a file
less - Browse a text file
ls - List the contents of a directory
man - Display a reference manual page
more - Display a text file
pwd - Display the working directory pathname
tail - Display the end of a file
who - Display who is on the system

Process commands
exit - Terminate a process
kill - Terminate or send a signal to a process
passwd - Create or change a password
ps - Display the status of a process
telnet - Connect to a remote system using the Telnet protocol

See http://cdsmith.twu.net/professional/osdesign.html for more information about OS as a subject,


and a quick survey of its benefits and jobs.

6/6

You might also like