Follow us on facebook

Monday 18 March 2013

Intro to Linux


Linux Operating System

Linux is a free open-source operating system based on Unix. Linux was originally created by Linus Torvalds 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 time and huge amount money to obtain licenses since Linux and much of it's software come with the GNU General Public License. There is no need to worry about any software's that you use in Linux.
Stability: Linux has high stability compared with other operating systems. There is no need to reboot the Linux system to maintain performance levels. Rarely it freeze up or slow down. It has a 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 develop and support different distribution. You can pick the one you like best; the core function's are the same.
Fast and easy installation: Linux distributions come with user-friendly installation.
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.
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 Vs Windows

Linux is an open-source Operating System. People can change codes and add programs to Linux OS which will help use your 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 onw extension. Linux wants the programmers to extend and redesign it's OS. Linux user's 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.
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. For server use, Linux is cheap compared to Windows. Microsoft allows a single copy of Windows to be used on one computer. You can run Linux on any number of computers.
Linux has hign 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 previlage.
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.
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
In Linux each user will have a home directory and all his files will be save 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 its easy to have backup's.

Linux Pros

A lot of the advantages of Linux are a consequence of Linux' origins, deeply rooted in UNIX, except for the first advantage, of course:

  • Linux is free:
    As in free beer, they say. If you want to spend absolutely nothing, you don't even have to pay the price of a CD. Linux can be downloaded in its entirety from the Internet completely for free. No registration fees, no costs per user, free updates, and freely available source code in case you want to change the behavior of your system.
    Most of all, Linux is free as in free speech:
    The license commonly used is the GNU Public License (GPL). The license says that anybody who may want to do so, has the right to change Linux and eventually to redistribute a changed version, on the one condition that the code is still available after redistribution. In practice, you are free to grab a kernel image, for instance to add support for teletransportation machines or time travel and sell your new code, as long as your customers can still have a copy of that code.
  • Linux is portable to any hardware platform:
    A vendor who wants to sell a new type of computer and who doesn't know what kind of OS his new machine will run (say the CPU in your car or washing machine), can take a Linux kernel and make it work on his hardware, because documentation related to this activity is freely available.
  • 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:
    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.

1.4.2. Linux Cons


  • There are far too many different distributions:
    "Quot capites, tot rationes", as the Romans already said: the more people, the more opinions. At first glance, the amount of Linux distributions can be frightening, or ridiculous, depending on your point of view. But it also means that everyone will find what he or she needs. You don't need to be an expert to find a suitable release.
    When asked, generally every Linux user will say that the best distribution is the specific version he is using. So which one should you choose? Don't worry too much about that: all releases contain more or less the same set of basic packages. On top of the basics, special third party software is added making, for example, TurboLinux more suitable for the small and medium enterprise, RedHat for servers and SuSE for workstations. However, the differences are likely to be very superficial. The best strategy is to test a couple of distributions; unfortunately not everybody has the time for this. Luckily, there is plenty of advice on the subject of choosing your Linux. A quick search on Google, using the keywords "choosing your distribution" brings up tens of links to good advise. The Installation HOWTO also discusses choosing your distribution.
  • Linux is not very user friendly and confusing for beginners:
    It must be said that Linux, at least the core system, is less userfriendly to use than MS Windows and certainly more difficult than MacOS, but... In light of its popularity, considerable effort has been made to make Linux even easier to use, especially for new users. More information is being released daily, such as this guide, to help fill the gap for documentation available to users at all levels.
  • Is an Open Source product trustworthy?
    How can something that is free also be reliable? Linux users have the choice whether to use Linux or not, which gives them an enormous advantage compared to users of proprietary software, who don't have that kind of freedom. After long periods of testing, most Linux users come to the conclusion that Linux is not only as good, but in many cases better and faster that the traditional solutions. If Linux were not trustworthy, it would have been long gone, never knowing the popularity it has now, with millions of users. Now users can influence their systems and share their remarks with the community, so the system gets better and better every day. It is a project that is never finished, that is true, but in an ever changing environment, Linux is also a project that continues to strive for perfection.

Linux Basic Commands


Linux operating system has a beautiful graphical interface which most of us will be using. It will be good to learn the basic commands in Linux to work interactively with the Linux operating system. Linux has a back end access know as shell. You can control and activate all the process in Linux from the shell. So it is very important to learn few basic commands to work with Linux operating system. 

Navigation Commands - [ pwd, cd ]

pwd
This command is used to find the current location or current working directory.
Eg:
[user@ws26 ~]$ pwd
/home/user
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.
Concider you have a directory structure /home/user/test/test1/ . test and test1 are directories in user home.
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 ..
[user@ws26 ~]$ pwd
/home/user
Example 3:
To get back to the home directory of the user
[user@ws26 ~]$ cd ~
[user@ws26 ~]$ pwd
/home/user.

Listing contents in a directory - [ ls, ls -l, ll ]Listing contents in a directory - [ ls, ls -l, ll ]


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

Reading files in Linux - [ cat, more, less ]


at
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..

Manipulating files - [ cp, mv, rm, mkdir ]

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 contect press ":wq" to save the file.


0 comments:

Post a Comment