You are on page 1of 6

Sumanta Das

Dept. of CSE, NSEC sumantadas04@yahoo.co.in

Linux Operating System

Introduction
Linux is a free open-source operating system based on Unix. Linus Torvalds originally
created Linux with the assistance of developers from around the globe. Linux is free to
download, edit and distribute. Linux is a very powerful operating system and it is
gradually becoming popular throughout the world.

Advantages of Linux
Low cost:
There is no need to spend huge amount money to obtain licenses since Linux and much
of it’s software come with the GNU General Public License.
Stability:
Linux has high stability compared with other operating systems. There is no need to
reboot the Linux system to maintain performance levels. It has continuous up-times of
hundreds of days or more.
Performance:
Linux provides high performance on various networks. It has the ability to handle large
numbers of users simultaneously.
Networking:
Linux provides a strong support for network functionality; client and server systems can
be easily set up on any computer running Linux. It can perform tasks like network backup
more faster than other operating systems.
Flexibility:
Linux is very flexible. Linux can be used for high performance server applications,
desktop applications, and embedded systems. You can install only the needed
components for a particular use. You can also restrict the use of specific computers.
Compatibility:
It runs all common Unix software packages and can process all common file formats.
Wider Choice:
There is a large number of Linux distributions which gives you a wider choice. Each
organization develops and support different distribution. You can pick the one you like
best; the core functions are the same.
Better use of hard disk:
Linux uses its resources well enough even when the hard disk is almost full.
Multitasking:
Linux is a multitasking operating system. It can handle many things at the same time.
Security:
Linux is one of the most secure operating systems. File ownership and permissions make
Linux more secure.
Open source:
Linux is an Open source operating systems. You can easily get the source code for Linux
and edit it to develop your personal operating system.

Page 1 of 6
Sumanta Das
Dept. of CSE, NSEC sumantadas04@yahoo.co.in

Today, Linux is widely used for both basic home and office uses. It is the main operating
system used for high performance business and in web servers. Linux has made a high
impact in this world.

Difference between Linux and Windows


Linux is an open-source Operating System. People can change codes and add programs to
Linux OS, which will help use our computer better. Linux evolved as a reaction to the
monopoly position of windows. You can't change any code for windows OS. You can't
even see which processes do what and build your own extension. Linux wants the
programmers to extend and redesign its OS. Linux users can edit its OS and design new
OS.

 All flavors of Windows come from Microsoft. Linux come from different
companies like LIndows , Lycoris, Red Hat, SuSe, Mandrake, Knopping,
Slackware, etc.
 Linux is customizable but Windows is not. For example, NASlite is a version of
Linux that runs off a single floppy disk and converts an old computer into a file
server. This ultra small edition of Linux is capable of networking; file sharing and
being a web server.
 Linux is freely available for desktop or home use but Windows is expensive..
 Linux has high security. You have to log on to Linux with a userid and password.
You can login as root or as normal user. The root has full privilege.
 Linux has a reputation for fewer bugs than Windows.
 Windows must boot from a primary partition. Linux can boot from either a
primary partition or a logical partition inside an extended partition. Windows
must boot from the first hard disk. Linux can boot from any hard disk in the
computer.
 Windows uses a hidden file for its swap file. Typically this file resides in the same
partition as the OS (advanced users can opt to put the file in another partition).
Linux uses a dedicated partition for its swap file.

Things to remember

 Windows separates directories with a back slash while Linux uses a normal
forward slash.
 Windows file names are not case sensitive. Linux file names are. For example
"abc" and "aBC" are different files in Linux, whereas in Windows it would refer
to the same file.
 Windows and Linux have different concepts for their file hierarchy. Windows
uses a volume-based file hierarchy while Linux uses a unified scheme. Windows
uses letters of the alphabet to represent different devices and different hard disk
partitions. eg: c: , d: , e: etc.. While in Linux " / " is the main directory.
 Linux and windows support the concept of hidden files. In Linux hidden files
begin with “. ", eg: .filename

Page 2 of 6
Sumanta Das
Dept. of CSE, NSEC sumantadas04@yahoo.co.in

 In Linux each user will have a home directory and all his files will be saved under
it while in windows the user saves his files anywhere in the drive. This makes
difficult to have backup for his contents. In Linux, it is easy to have backups.

Linux Directory Structure

" / " is the root Directory in Linux. " /root " will be the home directory for the root user
(administrator). root will have the full administrative power over the system and other
users. There are other directories like / home, /bin, /sbin, /lib etc. Each user will have
there own home directory

/ ---------> Root or the main directory


|---root ---------> Home directory for the root user
|---home ---------> User's home directories
| |----ftp ---------> Users services are listed here
| |----httpd
| |----samba
| |----user1
| |----user2
|---bin ---------> Commands needed during bootup and also needed by normal
users
|---sbin ---------> Like bin but commands are not intended for normal users.
|---proc ---------> This filesystem is not on a disk. virtual directory.
| |
| |----n ---------> A directory with info about process number n.
|
|---usr ---------> Contains all commands, libraries, man pages etc for normal
operation.
| |
| |----bin ---------> Almost all user commands.
| |----sbin ---------> System admin commands not needed in the root filesystem.
| |
| |----include ---------> Header files for the C programming language.
| |
| |----lib ---------> Unchanging data files for programs and subsystems
| |----local ---------> Locally installed software and other files.
| |----man --------> Help pages
| |----info ---------> Info documents
| |----doc ---------> Documentation for various packages
| |----tmp
| |----X11R6 ---------> The X windows system files.
| |
| |----X386 ---------> Like X11R6 but for X11 release 5
|---boot ---------> Files used by the bootstrap loader, LILO. Kernel images stored.
|---lib ---------> Shared libraries needed by the programs on the root filesystem
| |----modules ---------> Loadable kernel modules.

Page 3 of 6
Sumanta Das
Dept. of CSE, NSEC sumantadas04@yahoo.co.in

|
|---dev ---------> Device files for devices such as disk drives, serial ports, etc.
|---etc ---------> Configuration files specific to the machine.
| |----skel ---------> For home directory creation.
| |----sysconfig ---------> Files that configure the linux system for networking etc.
|---var ---------> Contains files that change for mail, news, temp files, etc
| |----file
| |----run ---------> Files that contain information about the system.
| |----spool ---------> Directories for mail, printer spools, news and other spooled
work.
| |----tmp ---------> Temporary files that are needed to exist for longer time.
| |
|---mnt ---------> Mount points for temporary mounts by the system administrator.
|---tmp ---------> Temporary files. Programs running after bootup should use /var/tmp.

Linux Basic Commands


Linux operating system has both graphical front-end interfaces and has a back end access
(know as shell). You can control and activate all the process in Linux from the shell.

To know about each command and its usage try the following.
man command-name
Example:
man ls

pwd
This command is used to find the current location or current working directory.

cd
This command id used to change the directory. You can move from one directory to
another using this command. Few examples are given below.

Example 1:
Consider you have a directory "test" in /home/user. Your current working directory is
/home/user. You want to change your current working directory from /home/user to
/home/user/test, use the following command
[user@ws26 ~]$ pwd
/home/user
[user@ws26 ~]$ cd test
[user@ws26 ~]$ pwd
/home/user/test

Example 2:
If you want to move back to /home/user, use the following command
[user@ws26 ~]$ cd ..

Page 4 of 6
Sumanta Das
Dept. of CSE, NSEC sumantadas04@yahoo.co.in

[user@ws26 ~]$ pwd


/home/user

ls
This command is used to list all the files and directory in the current directory.

Eg:
[user@ws26 ~]$ ls
1152696870.jpg book OperaDownloads snapshot52.png
image300.jpg Desktop test spiderman2.jpg

ls -l or ll
This command is also used to list all the files and directories. Here you will get more
details about the files and directories present in the current directory. You will see the
permission set, creation date, file / directory size etc.

Eg:
[user@ws26 ~]$ ls -l
total 5
-rw-rw-r-- 1 user user 33188 Dec 22 02:56 1152696870.jpg
-rw-rw-r-- 1 user user 17647 Aug 19 2006 534458.gif
-rw-rw-r-- 1 user user 26817 Aug 19 2006 534477.gif
drwxrwxr-x 2 user user 4096 Jan 13 04:20 book
drwx------ 3 user user 4096 Feb 4 02:34 Desktop

Cat
This command is used to display the contents of a file. You can read the file contents
using the cat command.

Example:
[user@ws26 ~]$ cat testfile
this is a test file.. You can read me..

Less and More


Both the less and more commands serve similar function. They are used to display file
one screen at a time. You can press spacebar to continue reading the file. These
commands are mainly used while reading large files.

Example 1:
[user@ws26 ~]$ less testfile
this is a test file.. You can read me..

Example 2:
[user@ws26 ~]$ more testfile
this is a test file.. You can read me..

Page 5 of 6
Sumanta Das
Dept. of CSE, NSEC sumantadas04@yahoo.co.in

cp
This command is used to copy files/directory.

Example:
[user@ws26 ~]$ cp file1 directory1
This will copy the file1 into the directory1

cp -R
This command is used to copy directories recursively (copy all the files and folders
inside the directory).

Example:
[user@ws26 ~]$ cp directory2 directory1
This will copy the whole directory2 into directory1

mv
This command is used to move the file or directory.

Example:
[user@ws26 ~]$ mv directory2 directory1
This will move the whole directory2 into directory1

rm
This command is used to remove or delete files and directories.

Example:
[user@ws26 ~]$ rm directory2
This will delete the directory - directory2

mkdir
This command is used to create a new directory

Example:
[user@ws26 ~]$ mkdir directory3
This will create a new directory - directory3.

Create new file in Linux - vi editor


The Vi editor is mainly used to create new files in Linux.
Example:
vi testfile
The command will open a new window and you can insert text to it. To begin, press "i".
After adding your content press ":wq" to save the file.

------o------

Page 6 of 6

You might also like