Introducing Linux

Home Linux Pre Installation Dual Booting Linux Introducing Linux Installing Softwares Vi Text Editor File System Man and Info Linux Links

Introduction to Linux

Linux is an operating system, a software program that provides a standardenvironment in which application programs can run, that is closely related to Unix, an influential operating system developed at AT&T’s Bell Laboratories during the 1970s. Although Unix continues to evolve and retain its popularity, particularly as an operating system for powerful network servers, many varieties of Unix are proprietary. Linux, on the other hand, is an opensource operating system and can be freely downloaded from Internet sites.

The source code for Linux is readily available and can be revised or improved by anyone having the requisite technical skill. Moreover, Linux is freely redistributable. You can make additional copies of Linux and give—or sell—them to others, so long as you observe several simple copyright restrictions. These qualities make Linux more attractive than Unix to many and explain its popularity as a leading Internet operating system.

Fundamentals of Linux

 Login in to the system: -

 As far as logging in is concerned linux has two modes that some of you may be familiar with and are called CLI and GUI mode


The GUI mode is more and the same as you use your windows or MAC whereas the CLI mode is more interactive and is considered as more powerful, this mode will also be more universal that means the command on most of different linux types will be the same as compared with the GUI mode. you should also have more experience in the CLI mode reason being say your GUI (also called the X Windows) somehow is not working this doesn’t mean that your OS is down but you can check to see if the CLI mode is working and debug the OS from there in order to get the GUI mode working again.


GUI mode of linux comes in various flavors with minor or major differences in the way linux OS is presented to you

GNOME

KDE

these are the two most common and famous type of GUI desktop environments.

 So as I explained that the CLI mode is more powerful and also adding to that to pass exams like Linux+ and RHCE you have to be more familiar with the CLI mode lets get started with the CLI mode with some basic commands.


1) pwd

print working directory


When you login to linux OS via CLI by default you get into the home directory of the user that you logged in as you can check the location of the user's home directory on the linux directory structure (we will cover directory structure later) and by default this is on the /home directory.

So pwd basically tells you the current directory name and its absolute location on the linux directory structure.

2) ls

lists contents of the directory
    

3) cd

Change Directory the same as the good old DOS command

Now there are some options for cd like : -

                        cd.. will move you up one directory

                        cd ~ will take you to the home directory of the user.

Lets discuss one of the important feature of most of the linux type OS.

Command Completion

There is a special option the way linux CLI works it completes the commands and filenames for you and you may not have to type the entire complete command and or the file name.

Hitting the tab on the keyboard completes the command but there is a rule for this : -

Command completion will work as far as typed letters on the CLI are unique but if there are two commands or files with the same first letters typed then it will give you the options to choose from the either of the two possibilities again you can complete the command by typing the different letter.

If confused just try this out on your linux box Type any letter and hit tab say y to get all the possible commands starting with that letter choose one letter of the command you want to run and hit tab again by the time you do that you will understand that it again displays the results of the possibilities but still the options are now less as we have two letters that narrows the options.

Ok lets get back to the commands we were discussing

4) clear

Command used to clear the screen.

5) rm –i  <filename>

this is the command to remove or delete a file the option –i will inquire and you have to say y or n to confirm the removal of the file.

6) mv

Moves the file from one name to the other or from one directory to the other it is also called as renaming file and also the original file is removed.

7) mkdir

Makes a directory

8) rmdir

Removes the directory only works on empty directory just a security feature so that you don’t delete the contents of a directory without knowing whats inside the directory. Directory with contents have to be removed using the rm-rf  <directory name> command

9) find

The find command helps you locate a file. The find command provides many ways of finding files, but it’s most often used to find a file by name. This is helpful when you have many directories, and you’re unsure which directory contains the file. For example, the command

find /home/fred –name filex

will tell you what folder within the directory

/home/fred

contains the file filex .

If you don’t know the name of the file, but you know a string containedwithin the filename, you can use a command such as this:

find /home/fred –name ‘*ile*’

This command will find all the files whose filenames contain the characters ile that reside in /home/fred and its subdirectories.

10) less

The less command lets you page through a text file much as the man command lets you page through a man page. You use the same characters to control both programs. For example, to page through the file /etc/hosts, issue the command

less /etc/hosts

Thats Enough for one day We will start with Text editors Next