Saturday, August 25, 2012

UNIX Shell - Script Basics



Script Basics

In Chapter 1, "Shell Basics," I introduced the concept of a shell and commands. I showed you how the shell reads your input and executes the command you requested.

In this chapter I will explain in detail what the shell is and how it works. You will learn how the shell is started during the login process and what happens when you log out.

After I explain this behavior, I will show you how to group commands that are normally executed interactively into a file to create a script. Scripts are the power behind the shell because they enable you to group commands together to create new commands.

The UNIX System

Logging In

The UNIX system consists of two components:
  • Utilities
  • The kernel
Utilities are programs you can run or execute. The programs who and date that you saw in the previous chapter are examples of utilities. Almost every program that you know is considered a utility.

Commands are slightly different than utilities. The term utility refers to the name of a program, whereas the term command refers to the program and any arguments you specify to that program to change its behavior. You might see the term command used instead of the term utility for simple commands, where only the program name to execute is given.

The kernel is the heart of the UNIX system. It provides utilities with a means of accessing a machine's hardware. It also handles the scheduling and execution of commands.

When a machine is turned off, both the kernel and the utilities are stored on the machine's hard disks. But when the computer is booted, the kernel is loaded from disk into memory. The kernel remains in memory until the machine is turned off.

Utilities, on the other hand, are stored on disk and loaded into memory only when they are executed. For example, when you execute the command

$ who

the kernel loads the who command from the machine's hard disk, places it in memory, and executes it. When the program finishes executing, it remains in the machine's memory for a short period of time before it is removed. This enables frequently used commands to execute faster. Consider what happens when you execute the date command three times:

$ date
Sun Dec 27 09:42:37 PST 1998
$ date
Sun Dec 27 09:42:38 PST 1998
$ date
Sun Dec 27 09:42:39 PST 1998

The first time the date command can be loaded from the machine's hard disk, but the second and third time the date command usually remains in the machine's memory allowing it to execute faster. The shell is a program similar to the who command. The main difference is that the shell is loaded into memory when you  log in.

Logging In

When you first connect to a UNIX system, you usually see a prompt such as the following:

login:

You need to enter your username at this prompt. After you enter your username, another prompt is  presented:

login: ranga
Password:

You need to enter your password at this prompt.

These two prompts are presented by a program called getty. These are its tasks:
1. Display the prompt login.
2. Wait for a user to type a username.
3. After a username has been entered, display the password prompt.
4. Wait for a user to enter a password.
5. Give the username and password entered by the user to the login command and exit.

After login receives your username and password, it looks through the file /etc/passwd for an entry
matching the information you provided. If it finds a match, login executes a shell and exits.

As an example, on my system the matching entry for my username, ranga, in file /etc/passwd is:

ranga:x:500:100:Sriranga Veeraraghavan:/home/ranga:/bin/bash

If no match is found, the login program issues an error message and exits. At this point the getty program takes over and displays a new login prompt.
The shell that login executes is specified in the file /etc/passwd. Usually this is one of the shells that I
covered in the previous chapter.

In this blog I assume that the shell started by the login program is /bin/sh. Depending on the version of
UNIX you are running, this might or might not be the Bourne shell:
  • On Solaris and FreeBSD, it is the Bourne shell.
  • On HP-UX, it is the POSIX shell.
  • On Linux, it is the Bourne Again shell.

Shell Initialization

When the login program executes a shell, that shell is uninitialized. When a shell is uninitialized, important parameters required by the shell to function correctly are not defined.
The shell undergoes a phase called initialization to set up these parameters. This is usually a two step process that involves the shell reading the following files:
  •  /etc/profile
  •  profile

The process is as follows:
1. The shell checks to see whether the file /etc/profile exists.
2. If it exists, the shell reads it. Otherwise, this file is skipped. No error message is displayed.
3. The shell checks to see whether the file .profile exists in your home directory. Your home
directory is the directory that you start out in after you log in.
4. If it exists, the shell reads it; otherwise, the shell skips it. No error message is displayed.

As soon as both of these files have been read, the shell displays a prompt:

$

This is the prompt where you can enter commands in order to have them execute.

Note - The shell initialization process detailed here applies to all Bourne type shells, but some additional files are used by bash and ksh.
You can obtain more information about this process for a particular shell using the man command explained later in this chapter.


Interactive Versus Noninteractive Shells


When the shell displays a prompt for you, it is running in interactive mode.

Interactive mode means that the shell expects to read input from you and execute the commands that you specify. This mode is called interactive because the shell is interacting with a user. This is usually the mode of the shell that most users are familiar with: you log in, execute some commands, and log out. When you log out using the exit command, the shell exits. The shell can be run in another mode, called noninteractive mode . In this mode, the shell does not interact with you; instead it reads commands stored in a file and executes them. When it reaches the end of the file, the shell exits.

How login Starts a Shell


When the login program starts a shell, it basically executes the following command:

/bin/sh

By issuing this command, it puts the shell into interactive mode. You can start a shell in interactive mode by issuing the same command at the prompt:

$ /bin/sh
$

The first prompt $ is displayed by the shell that login started; the second one is displayed by the shell you started. To exit from this shell, use the exit command:

$ exit
$

The prompt that is displayed now is from the original shell started by login. Typing exit at this prompt logs you out.

How to Start the Shell Noninteractively

You can start the shell noninteractively as follows:

$ /bin/sh filename

Here filename is the name of a file that contains commands to execute. As an example, consider the compound command:

$ date ; who

Put these commands into a file called logins. First open a file called logins in an editor and type the command shown previously. Assuming that the file is located in the current directory, after the file is saved, the command can run as

$ /bin/sh logins

This executes the compound command and displays its output.

This is the first example of a shell script . Basically, a shell script is a list of commands stored in a file that the  shell executes noninteractively.

Initialization File Contents

Usually the shell initialization files are quite short. They are designed to provide a complete working environment with as little overhead as possible for both interactive and noninteractive shells.
The file /etc/profile is maintained by the system administrator of your UNIX machine and contains shell initialization information required by all users on a system.
The file .profile is under your control. You can add as much shell customization information as you want to this file. The minimum set of information that you need to configure includes
  •  The type of terminal you are using
  •  A list of directories in which to locate commands
  •  A list of directories in which to locate manual pages for commands

Setting the Terminal Type

Usually the type of terminal you are using is automatically configured by either the login or getty programs. Sometimes, the autoconfiguration process guesses your terminal incorrectly. This can occur when you are using a dial-up or modem connection. If your terminal is set incorrectly, the output of commands might look strange, or you might not be able to interact with the shell properly. To make sure that this is not the case, most users set their terminal to the lowest common denominator as follows:

TERM=vt100

When I introduce the case statement in Chapter 10, "Flow Control," you will see a more advanced method of setting the terminal type that enables access to advanced terminal features.
Setting the PATH
When you type the command
$ date
the shell has to locate the command date before it can be executed. The PATH specifies the locations in which the shell should look for commands. Usually it is set as follows:

PATH=/bin:/usr/bin

If you request the shell to execute a command and it cannot find it in any of the directories given in the PATH variable, a message similar to the following appears:

$ hello
hello: not found

Setting the MANPATH

In UNIX, online help has been available since the beginning. In the section "Getting Help" I will discuss how to access it using the man command.
In order for you to access all the available help, you have to tell the shell where to look for the online help pages. This information is specified using the MANPATH. A common setting is 

MANPATH=/usr/man:/usr/share/man

Like the path, each of the individual entries separated by the colon character, :, are directories.
When you use the man command to request online help as follows, the man command searches every directory given in the MANPATH for an online help page corresponding to the topic you requested.

$ man who

In this case it looks for the online help page corresponding to the who command. If this page is found, it is displayed as discussed in the next section.

Making a Shell Script Executable

One of the most important tasks in writing shell scripts is making the shell script executable and making sure that the correct shell is invoked on the script.
In a previous example, you created the logins script that executes the following compound command:
date ; who ;
If you wanted to run the script by typing its name, you need to do two things:
  •  Make it executable.
  •  Make sure that the right shell is used when the script is run.
To make this script executable, do the following:

chmod a+x ./logins

To ensure that the correct shell is used to run the script, you must add the following "magic" line to the beginning of the script:

#!/bin/sh

Your script then has two lines:

#/bin/sh
date ; who ;

The magic line causes a new shell (in this case, /bin/sh) to be called to execute the script. Without the magic line, the current shell is always used to evaluate the script, regardless of which shell the script was written for. For example, without a magic line, csh and tcsh users might not be able to get a Bourne shell (sh) script to run correctly.

The Magic of #!/bin/sh
The #!/bin/sh must be the first line of a shell script in order for sh to be used to run the script. If this appears on any other line, it is treated as a comment and ignored by all shells.

The magic first line #!/bin/sh introduces the topic of comments. A comment is a statement that is embedded  in a shell script but should not be executed by the shell.
In shell scripts, comments start with the # character. Everything between the # and end of the line are considered part of the comment and are ignored by the shell. 
Adding comments to a script is quite simple: Open the script using an editor and add lines that start with the
# character. 
For example, to add the following line to the logins shell script:
# print out the date and who's logged on

I opened the file logins with my editor and inserted this line as the second line in the file. The shell script is now as follows:

#!/bin/sh
# print out the date and who's logged on
date ; who ;

There is no change in the output of the script because comments are ignored. Also comments do not slow down a script because the shell can easily skip them.

You can also add comments to lines that contain commands by adding the # character after the commands.
For example, you can add a comment to the line date ; who ; as follows:

date ; who ; # execute the date and who commands

When you are writing a shell script, make sure to use comments to explain what you are doing in case someone else has to look at your shell script. You might find that this helps you figure out what your own scripts are doing, months after you write them.

Getting Help

As you read through this blog, you will want to get more information about the commands and features I discuss. This information is available by using the online help feature of UNIX. Every version of UNIX  comes with an extensive collection of online help pages called manual pages. These are often referred to as man pages . The man pages are the authoritative source about your UNIX system. They contain complete information about both the kernel and all the utilities.

Using the man Command

To access a man page you need to use the man (man as in manual) command as follows:

man command

Here, command is the name of a command that you want more information about. As an example,

$ man uptime

displays the following on a Solaris machine:

User Commands uptime(1)
NAME
uptime - show how long the system has been up
SYNOPSIS
uptime
DESCRIPTION
The uptime command prints the current time, the length of time the system has been up, and the average number of jobs in the run queue over the last 1, 5 and 15 minutes. It is, essentially, the first line of a w(1) command.
EXAMPLE
Below is an example of the output uptime provides:
example% uptime
10:47am up 27 day(s), 50 mins, 1 user, load average: 0.18, 0.26, 0.20
SEE ALSO
w(1), who(1), whodo(1M), attributes(5)
NOTES
who -b gives the time the system was last booted.

Sections in a Man Page

Section
Description
NAME
This section gives the name of the command along with a short description of the
command.
SYNOPSIS
This section describes all the different modes in which the command can be run. If a
command accepts arguments they are shown in this section.
DESCRIPTION
This section includes a verbose description of the command. If a command accepts
arguments, each argument will be fully explained in this section
EXAMPLE
This section usually shows you how to execute a command, along with some sample
output.
SEE ALSO
This section lists other commands that are related to this command.
NOTES
This section usually lists some additional information about the command. Sometimes it
lists known bugs with a particular command.
Try using the man command to get more information on some of the commands I have discussed in this chapter.
If the man command cannot find a man page corresponding to the command you requested, it issues an error message. For example, the command

$ man apple

produces an error message similar to the following on my system:

No manual entry for apple

The exact error message depends on your version of UNIX.

Summary

In this chapter, I explained in greater detail what the shell is and how it works. You saw how the login process works and what the login command does to start a shell. From this you were able to look at the two modes in which the shell can be run:
  •  Interactively
  •  Noninteractively
In shell programming, the noninteractive use of the shell should interest you the most. This mode enables you to specify commands inside a file and then have the shell execute the commands within that file. You also saw how to make a file containing commands executable. This enables you to treat shell scripts as new commands.You also looked at some details of shell initialization and getting help using the man command.

The next chapter formally introduces the concept of files by showing you how to list files, view the contents of files, and manipulate files.

Questions

1. What are the two files used by the shell to initialize itself?

2. Why do you need to set PATH and MANPATH?

3. What purpose does the following line
#!/bin/sh
serve in a script?

4. What command should you use to access the online help?


Terms

Utilities Utilities are programs, such as who and date, that you can run or execute.

Commands A command is the name of a program and any arguments you specify to that program to cause its behavior to change. You might see the term command used instead of the term utility for simple commands, where only the program name to execute is given.

Kernel The kernel is the heart of the UNIX system. It provides utilities with a means of accessing a  machine's hardware. It also handles the scheduling and execution of commands.

Uninitialized Shell When a shell is started it is uninitialized. This means that important parameters required  by the shell to function correctly are not defined.

Shell Initialization After a shell is started it undergoes a phase called initialization to set up some important parameters. This is usually a two step process that involves the shell reading the files /etc/profile and .profile.

Interactive Mode In interactive mode the shell reads input from you and executes the commands that you specify. This mode is called interactive because the shell is interacting with a user.

Noninteractive Mode In noninteractive mode, the shell does not interact with you; instead it reads commands stored in a file and executes them. When it reaches the end of the file, the shell exits.

Shell Script A shell script is a list of commands stored in a file that the shell executes noninteractively.

Home Directory Your home directory is the directory in which you start out after you log in.

Comments A comment is a statement that is embedded in a shell script but should not be executed by the shell.

Man Pages Every version of UNIX comes with an extensive collection of online help pages called man pages (short for manual pages ). The man pages are the authoritative source about your UNIX system. They contain complete information about both the kernel and all the utilities.

Next Topic --- Working with Files

Thursday, August 23, 2012

Shell Basics




Shell Basics

Shell scripting is similar to a woodworking project. To build something out of wood, you need to use the right tools. In UNIX, the tools you use are called utilities or commands. There are simple commands like ls and cd, and there are power tools like awk, sed, and the shell.

One of the biggest problems in woodworking is using the wrong tool or technique while building a project.
Knowing which tool to use comes from experience. In this blog, you will learn how to use the UNIX tools via examples and exercises.

The simple tools are easy to learn. You probably already know how to use many of them. The power tools take longer to learn, but when you get the hang of them, you'll be able to tackle any problem. This blog teaches you how to use both the simple tools and the power tools. The main focus is on the most powerful tool in UNIX, the shell.

Before you can build things using the shell, you need to learn some basics. This chapter looks at the following topics:
  •  Commands
  •  The shell
It's time to get started.

What Is a Command?
Simple Commands, Compound Commands, Complex Commands and Command Separators.

In UNIX, a command is a program that you can run. In other operating systems, such as Mac OS or  Windows, you point to the program you want to run and click it. To run a command in UNIX, you type its name and press Enter.

For example:
$ date [ENTER]
Wed Dec 9 08:49:13 PST 1998
$

Here, the date command has been entered. This command displays the current day, date, time, and year.
After the current date appears, notice that the $ character is displayed.

Caution - The $ character is a prompt for you to enter a command. It is not part of the command itself.

$ who
vathsa tty1 Dec 6 19:36
sveerara ttyp2 Dec 6 19:38
ranga ttyp0 Dec 9 09:23
$

Here, I entered the command who at the prompt. This command displays a list of all the people, or users, who are currently using the UNIX machine.

The first column of the output lists the usernames of the people who are logged in. On my system, you can see that there are three users, vathsa, sveerara, and ranga. The second column lists the terminals they are logged in to, and the final column lists the time they logged in.

The output varies from system to system. Try it on your system to see who is logged in.

Simple Commands

The who and date commands are examples of simple commands. A simple command is one that you can execute by just giving its name at the prompt:

$ command

Here, command is the name of the command you want to execute. 

Simple commands in UNIX can be small commands like who and date, or they can be large commands like a Web browser or a spreadsheet program.You can execute most commands in UNIX as simple commands.

Complex Commands

You can use the who command to gather information about yourself when you execute it as follows:

$ who am i
ranga pts/0 Dec 9 08:49
$

This tells me the following information:
  •  My username is ranga.
  •  I am logged in to the terminal pts/0.
  •  I logged in at 8:49 on Dec 9.
This command also introduces the concept of a complex command, which is a command that consists of a command name and a list of arguments.
Arguments are command modifiers that change the behavior of a command. In this case, the command name is who, and the arguments are am and i.

The formal syntax for a complex command is:

$ command argument1 argument2 argument3 ... argumentN

Here, command is the name of the command you want to execute, and argument1 through argumentN are the arguments you want to give command.

Compound Commands

One of the most powerful features of UNIX is the capability to combine simple and complex commands together to obtain compound commands.
A compound command consists of a list of simple and complex commands separated by the semicolon  character ( ;). 

An example of a complex command is
$ date ; who am i ;
Wed Dec 9 10:10:10 PST 1998
ranga pts/0 Dec 9 08:49
$

Here, the compound command consists of the simple command date and the complex command who am i. As you can see from the output, the date command executes first, followed by the who am i command. When you give a compound command, each of the individual commands that compose it execute in order.

In this example, the complex command behaves as if you typed the commands in the following order:
$ date
Wed Dec 9 10:25:34 PST 1998
$ who am i
ranga pts/0 Dec 9 08:49
$

The main difference between executing commands in this fashion and using a complex command is that in a complex command you do not get the prompt back between the two commands.

The formal syntax for a complex command is:

$ command1 ; command2 ; command3 ; ... ; commandN ;

Here, command1 through commandN are either simple or complex commands. The order of execution is command1, followed by command2, followed by command3, and so on. When commandN finishes executing, the prompt returns.

Command Separators

The semicolon character ( ;) is treated as a command separator, which indicates where one command ends and another begins.
If you don't use it to separate each of the individual commands in a complex command, the computer will not be able to tell where one command ends and the next command starts. If you execute the previous example without the first semicolon
$ date who am i

an error message similar to the following will be produced:

date: bad conversion

Here, the date command thinks that it is being run as a complex command with the arguments who, am, and i. The date command is confused by these arguments and displays an error message. When using complex commands, remember to use the semicolon character.
You can also terminate individual simple and complex commands using the semicolon character. For example, the commands

$ date
and$ date ;

produce the same output due to the order in which commands execute.

In the first case, the simple command date executes, and the prompt returns.

In the second case, the computer thinks that a complex command is executing. It begins by executing the first command in the complex command. In this case, it is the date command. When this command finishes, the computer tries to execute the next command. Because no other commands are left to execute, the prompt returns.


Note - You will frequently see the semicolon used to terminate simple and complex commands in scripts. Because the semicolon is required to terminate commands in other languages, such as C, Perl, and Java, many script programmers use it the same way in scripts. No extra overhead is incurred by using the semicolon in this manner.


What Is the Shell?

  • The Shell Prompt
  • Different Types of Shells

In the preceding section, I explained that when you type the command
$ date

the computer executes the date command and displays the result.
But how does the computer know that you wanted to run the command date?

The computer uses a special program called the shell to figure this out. The shell provides you with an interface to the UNIX system. It gathers input from you and executes programs based on that input. When a program finishes executing, it displays that program's output.

For this reason, the shell is often referred to as the UNIX system's command interpreter. For users familiar with Windows, the UNIX shell is similar to the DOS shell, COMMAND.COM.

The real power of the UNIX shell lies in the fact that it is much more than a command interpreter. It is also a powerful programming language, complete with conditional statements, loops, and functions. If you are familiar with these types of statements from other programming languages, great. You'll pick up shell programming quickly. If you haven't seen these before, don't fret. By the time you finish this blog, you'll know how to use each of these statements.

The Shell Prompt

The prompt, $, which was discussed in the beginning of this chapter, is issued by the shell. While the prompt is displayed, you can type a command. The shell reads your input after you press Enter. It determines the command you want executed by looking at the first word of your input. A word is an unbroken set of characters. Spaces and tabs separate words.

To the shell, your input looks like the following:
$ word1 word2 word3 ... wordN

The shell always picks word1 as the name of the command you want executed. If there is only one word 
$ date
the shell's job is easy. It executes the command. If there are more words
$ who am i
the shell passes the extra words as arguments to the command specified by word1.

Different Types of Shells

You might notice that your prompt looks slightly different than the $ prompt I am using. The actual prompt that is displayed depends on the type of shell you are using.
In UNIX there are two major types of shells:
  •  The Bourne shell (includes sh, ksh, and bash)
  •  The C shell (includes csh and tcsh)

If you are using a Bourne-type shell, the default prompt is the $ character. If you are using a C-type shell, the default prompt is the % character. This blog covers only Bourne-type shells because the C-type shells are not powerful enough for shell programming.

Note - In UNIX there are two types of accounts, regular user accounts and the root account. Normal users are given regular user accounts. The root account is an account with special privileges the administrator of a UNIX system (called the sysadmin) uses to perform maintenance and upgrades.
If you are using the root account, both the Bourne and C shells display the # character as a prompt. Be extremely careful when executing commands as the root user because your commands effect the whole system.

None of the examples in this blog require that you have access to the root account to execute them.



The different Bourne-type shells follow:
  •  Bourne shell ( sh)
  •  Korn shell ( ksh)
  •  Bourne Again shell ( bash)
  •  POSIX shell ( sh)

The different C-type shells follow:
  •  C shell ( csh)
  •  TENEX/TOPS C shell ( tcsh)

Unless explicitly noted, the examples and exercise answers in this blog will work with any Bourne-type shell.


Task:

1. Classify each of the following as simple, complex, or compound commands:
$ ls
$ date ; uptime
$ ls -l
$ echo "hello world"

2. What is the effect of putting a semicolon at the end of a single simple command or a complex command?

3. What are the two major types of shells? Give an example of a shell that falls into each type.


Wednesday, August 22, 2012

Solaris Directory Structure (File System Structure) Explained with Examples


Critical Directories


1. / – Root

  • Every single file and directory starts from the root directory.
  • Only root user has write privilege under this directory.
  • / is also the root account home directory.

2. /dev – Device files.

  • Contains device files.
  • These include terminal devices, usb, or any device attached to the system.
  • For example: /dev/tty1, /dev/usbmon0

3. /etc – Configuration files

  • Contains configuration files required by all programs.
  • This also contains startup and shutdown shell scripts used to start/stop individual programs.
  • For example: /etc/services, /etc/resolv.conf, /etc/inetd.conf

4. /home – Home Directories

  • Home directories for all users to store their personal files.
  • For example: /home/john, /home/nikita

5. /kernel – Kernel Components

  • Contains kernel components common to all platforms within a particular instruction set that are needed for booting the system.

6. /sbin – System Binaries

  • Just like /bin, /sbin also contains binary executables.
  • But, the commands located under this directory are used typically by system administrator, for system maintenance purpose.
  • For example: fdisk, mount, swapadd

7. /bin – User Binaries

  • this points to /usr/bin
  • All binaries are located under /usr/bin.

8. /lib – System Libraries

  • Contains library files that supports the binaries located under /bin and /sbin
  • Library filenames are lib*.so.*
  • For example: libmtsk.so, libncurses.so.5.7

9. /mnt – Mount Directory

  • Empty folder generally used for mounting file systems.

10. /opt – Optional add-on Applications

  • opt stands for optional.
  • Contains add-on applications from individual vendors.
  • add-on applications should be installed under either /opt/ or /opt/ sub-directory.

11. /platform – Platform Definition files

  • Contains platform definition files.
  • For example: /platform/SUNW,SPARC-Enterprise-T3120, /platform/SUNW,Sun-Blade-T6340

12. /proc – Process Information

  • Contains information about system process.
  • This is a pseudo filesystem contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid.
  • This is a virtual filesystem with text information about system resources. For example: /proc/uptime

13. /tmp – Temporary files

  • Directory that contains temporary files created by system and users.
  • Files under this directory are deleted when system is rebooted.

14. /usr – User Programs

  • Contains /usr/bin which is been linked from /bin.
  • Contains certain other links such as spool, news, man, mail.

15. /var – Variable files

  • var stands for variable files.
  • Content of the files that are expected to grow can be found under this directory.
  • This includes system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); temp files needed across reboots (/var/tmp);

16. /vol – Volumes directory

  • Disk volumes mounted under this directory.

Tuesday, August 21, 2012

Windows Basic Questions with solution



Ques-:  What is Operating System?
Ans: -    Operating System works as an interpreter between computer hardware and application. Operating System works as a user interface.

Ques-:  Types of Operating System?
Ans: -    There are two types of Operating System—
1.            SOS – Simple Operating System as for example – Windows 95, 98, ME
2.            NOS – Network Operating System as for example – Windows NT, 2000, 2003

Ques-: What is RAS Server?
Ans: -    RAS stands for Remote Access Server. It is basically use for mobile user in the network. This Server provides the remote access connectivity for mobile user. In this way all of the mobile users are connected to server through telephone line. This Server also provides the connectivity between two or more Offices in the Network.

Ques-:  What is VPN Server?
Ans: -    VPN stands for Virtual Private Network. It is basically use for mobile user in the network. This Server provides the remote access connectivity for mobile user. In this way all of the mobile users are connected to server through internet. This Server also provides the Connectivity between two or more Offices in the Network. VPN is Cost Effective (No costly).

Ques-:  What is IAS Server?
Ans: -IAS stands for Internet Authentication Services. IAS Server is also known as RADIUS Server. IAS Server provides the centralized management of multiple RAS & VPN Servers in the Network. On this Server Remote Access Policy and Remote Access Logging Options are available.

Ques-: FAT/NTFS?
Ans: -There is major differences are available between FAT and NTFS File System such as
FAT
•             Fat stands for File Allocation Table
•             There are two categories in Fat File System –FAT 16 And FAT 32.
•             In FAT up To Folder Level Security is available
•             Compression, Encryption, Disk Quota Option is not available
•             FAT Supported By All of the Microsoft Based Operating System
NTFS
•             NTFS stands for New Technology File System
•             There are three categories in NTFS file System
•             NTFS 4.0 – NT O/S, NTFS 5.0 – 2000 O/S, NTFS 6.0 – 2003O/S
•             In NTFS Up-to File Level Security is available
•             Compression, Encryption, Disk Quota Option is available
•             NTFS Supported By only Limited Microsoft Based Operating System

Ques-: What is the difference between Windows NT/2000/2003?
Ans: -There are many differences are available between Windows NT, 2000 and 2003 O/S, Such As--
Windows NT
             There is no active directory
             There is no tree/forest hierarchical structures are available
             There is no Site Relationship
             There is no parent domain and child domain concepts are available in the network.
             NT support NTFS 4.0 File system
             NT Support NTLM Version 2 LAN Authentication Protocol
             In NT by default no Trust Relationship are configured
             In NT we will use System Policy
             In NT specific Client Site Operating System is available i.e. NT Workstation 4.0 Edition
             In NT we will use Exchange 5.5 Server
             In NT We Can Create Only One Way Trust Relationship inside The Network.
Windows 2000
             There is Active Directory
             Tree/Forest Hierarchal Structure are available
             There is Site Relationship is available
             There is parent domain and child domain concepts are available
             2000 support NTFS 5.0 File system
             2000 Support Kerberos Version 5 Authentication Protocol
             In 2000 by default Two-Way Trust Relationship are configured
             In 2000 we will use Group Policy
             2000 support maximum 32 Processor and 64 GB RAM
             In 2000 specific Client Site Operating System is available i.e. 2000 Professional
             In 2000 we will use Exchange 2000 Server
             In 2000 no Stub Zone is available in DNS
             In 2000 Resultant Setup Policy is not available
             In 2000 GPMC is not available
             In 2000 Conditional Forwarding option is not available
             In 2000 Effective Permission option is not available
             In 2000 only some Administrative Command Line Tools are available
             Active Directory Saved Query Option is not available
             Shadow Copy Option is not available in Windows 2000 O/S
             ASR Option is not available in Windows 2000 O/S
             In Windows 2000 We Can Create Maximum 1 DFS Root On A Single DFS Server in The Network.
             In 2000 We Can Create Two Way Trust Relationship inside The Network.
Windows 2003
             There is Active Directory
             Tree Forest Hierarchal Structure are available
             There is Site Relationship is available
             There is parent domain and child domain concepts are available
             2003 support NTFS 6.0 File system
             2003 Support Kerberos Version 5 Authentication Protocol
             In 2003 we will use Group Policy
             2003 support maximum 64 Processor and 512 GB RAM
             In 2003 no specific Client Site Operating System is available you can use either win 2k Professional either Win XP Professional in
The Network.
             In 2003 we will use Exchange 2003 Server
             In 2003 Stub Zone is available in DNS
             In 2003 Resultant Setup Policy is available
             In 2003 GPMC is available
             In 2003 Conditional Forwarding option is available
             In 2003 Effective Permission option is available
             In 2003 more Administrative Command Line Tools are available
             Active Directory Saved Query Option is available
             Shadow Copy Option is available in Windows 2003 O/S
             ASR Option is available in Windows 2003 O/S
             In Windows 2003 We Can Create More Than 1 DFS Root On A Single DFS Server in The Network.
             In 2003 We Can Create Two Way Trust Relationship inside The Network.

What is Tree?
A group of domain is called tree and sharing a contiguous Name space.

What is Forest?
A group of tree is called forest and does not sharing a contiguous name space but sharing a common configuration (Schema).


Difference between D.C. and A.D.C.?
D.C. stands for Domain Controller and A.D.C. stands for Additional Domain Controller. A.D.C. is a back up copy of D.C. Only one different is available Between D.C. and A.D.C. i.e. - Operation Master Role.  On D.C all of the three Operation Master Roles are available—
RID Master
PDC Emulator
Infrastructure Operation Master Role
But on A.D.C no any operation master roles are available
What is the benefit of Child Domain?
There are many benefits of Child Domain Such As—
Security Boundary
Administrative Overhead Low
Network Traffic Low

What is OU?
OU stands for Organizational Unit. On OU we define group policy in the network. Group policy is basically assigned on active directory container i.e.  Site, domain, OU. Whenever we want some users in the network do not use shut down the system, do not use run command, do not use control panel, then we put that user in the OU and assign the appropriate Group Policy on that OU.


What is Group Policy?
Group policy provides the stream line access to all of the users in the network. Group policy is basically assigned on active directory container i.e.  Site, domain, OU. Whenever we want some users in the network do not use shut down the system, do not use run command, do not use control panel, then we put that user in the OU and assign the appropriate Group Policy on That OU.
Difference between Permission, Right and Policy?
Permission – Permission are basically assigned on network resources as for example – File, Folder, Share Folder, Printer
Right – Right is basically assign to users and groups.
Policy – Policy are basically assigned on active directory container i.e. - Site, Domain, OU.

What is ISA Server?
ISA stands for Internet Security Acceleration. ISA Server Provides the Internet connectivity for all of the users in network ISA server also works as a Proxy Server in the network. With the help of ISA Server Administrator can Filtering a Client request For a Specific Web site in the Network.

What is Site?
A Site is a geographical area where all of the domains are available. Site manages the Replication Traffic between Two or More Different Sites in the Network.

What is Operation Master Role?
Operation Master Role is available on Domain controller in the Network. There are Five types of Operation Master Role –
Schema Master
Domain Naming Master
RID Master
PDC Emulator
Infrastructure Operation Master Role

Difference between Mixed Mode and Native Mode?
There are three types of domain mode—
Mixed Mode – In this mode NT, win 2k and win 2k3 D.C are available.
Win 2k Native Modes – In this mode Win 2k And win 2k3 D.C are available.
Win 2k3 Native Mode – In this mode only win 2k3 D.C are available.

What is SCSI?
SCSI stands for Small Computer System Interface. In SCSI the rate of data transmission is fast. SCSI Hard Disk Speed—R.P.M is fast In SCSI Data Transmission Speed Is 320 MBPS in the Network. In SCSI Controller We Can connect Maximum 15 physical Devices in the System.

What are A-Host Record and PTR Record?
A record is also called host record. This record is basically created in forward lookup Zone.
PTR record is also called pointer record. This record is basically created in reverse lookup Zone.

What is Reservation?
Reservation Is Basically used In DHCP Server. When Ever we want This Computer Is Always received This IP address From DHCP Server in The network, in That Case we create a Reservation in DHCP Server Of that particular Computer in The Network.
IP Address Range/Classes?
There are two types of IP address—
Class Full IP Address
Class Less IP Address
Class Full IP Address – There are five classes – 
1. Class A             –             0 – 126 (127 is reserved for Loop back)
2. Class B              –             128 – 191
3. Class C              –             192 – 223
4. Class D             –             224 – 239
5. Class E              –             240 – 255

Difference between Hardware Router and Software Router?
Hardware Router – Hardware Router is a dedicated Router. It’s having a lot of features such as security, dedicated routing in the network. As for example Cisco Router.
Software Router – Software Router is not a dedicated Router. It provides the different services also, such as DNS server, DHCP Server. i.e.—Windows Based Router.


Difference between Hardware Firewall and Software Firewall?
Hardware Firewall – It is a dedicated Firewall. A lots of security features are available on hardware based firewall. As for example— Cisco pix Firewall.
Software Firewall – It is not a dedicated Firewall. Its provides the normal security in the network—check point

What is Domain Controller?
D.C stands for domain controller. It provides the centralized management of entire domain in the network. Whenever we will install active directory database on a server side operating system, then after that  system becomes a D.C. Domain Controller manages all security related Interaction between users and Computers in The Network.

What is B Router?
B Router stands for Bridge Router. We can say this is a layer three bridge that provides the communication between two or more different network ID.

What is Bridge?
Bridge is a layer 2 network device that provides the communication within the same network id. In Bridge Maximum 16 ports are available.

What is POP Server/SMTP Server?
POP stands for Post Office Protocol. It is basically use for mail receiving purpose in the network.
SMTP stands for Simple Mail Transfer Protocol. It is basically use for sending a mail as well as receiving a mail in the network.

What is Active Directory Partitions?
Active directory Partition Is a Logical Partition Of active directory. This Partition Is Basically Use for replication from D.C To A.D.C & D.C to G.C.S (Global Catalog server) in the Network. There are Four Types Of active Directory partition—
Schema partition
Configuration Partition
Domain Partition
Application partition

What is the Function of Ping Command?
Ping provides to check the Physical/IP Connectivity between two or more devices in the network. Ping sends an ICMP request from source computer to destination computer and destination computer sends an ICMP reply.

What is Group Nesting?
When we add two or more Groups within a Single Group, it is called Group Nesting.

What is FIXMBR?
FIXMBR Repair the Master boot Record of the Partition Boot Sector.

What is FIXBOOT?
FIXBOOT write a new Partition Boot Sector on to the system Partition.

What is SID?
SID stands for Security Identifier. Every Object has a unique ID, it is called SID.

What is RADIUS Serer?
RADIUS Stands for Remote Authentication Dial-in User Service. RADIUS Server Provides the Centralized management of Multiple RAS & VPN Server in the Network. On this Server Remote Access Policy and 
Remote Access Logging Options are available.

What is Trusting Domain?
In Trusting Domain Resources are available.

What is Trusted Domain?
In Trusted Domain User Account’s are available.

What is Microsoft Exchange Server?
Microsoft Exchange Server is Software that provides the services such as sending & receiving the Mail.

What Is Directory Services restore Mode?
When our Active Directory Database is Not Working Properly, Then We Restart the Domain Controller and Press f8 Key Then after Selecting the Directory Services Restore Mode and Then after Restoring the Active directory Database from the Last Backup.


What is encryption?
There are four types of encryption—
No Encryption – no
Basic – MPPE – 40 bits – des
Strong – 56 bits – des – MPPE/IPSec
Strongest – 128 bit data encryption – MPPE/IPSec


What is RIP v.1, RIP v.2, IGMP, OSPF?
RIP v.1 – Broadcast – Small Network Use
RIP v.2 – Multicast
IGMP – Multicast
OSPF – Multicast – For Larger Network


What is Inbound Connection?
Inbound connection is Created On server Side.

What is Outbound Connection?
Outbound connection is created on client Side.


What is The Function of jetpack command In DHCP Server?
Check the database consistency of DHCP  Server in the Network


What is Remote Access Policy?
In Remote Access Policy there are three options are available—
Condition – 8 a.m. to 5 p.m., Marketing Group
Permission – Yes/No
Profile – Connectivity time, IPSec Policy


What is the function of jetpack command in WINS server?
For Compacting the WINS database, we use jetpack command.
Jetpack wins.mdb kk.mdb


What is tunneling form?
The sending and receiving of data through a secure way in the network, it is called tunneling form.


What is trust relationship ?
Trust relationship is an important part in the client server network. There are two types of trust relationship—
Non Transitive Trust – Non Transitive Trust is a one way trust relationship in the network. As for example—in NT network
Transitive Trust – Transitive Trust is two way trust relationship in the network. As for example—in 2000/2003 network.


What is DACL?
DACL stand for Discretionary Access Control List. In DACL basically permission entry is available of any user in the network


What is SACL?
SACL stand for System Access Control List. In SACL basically auditing entry is available of any user in the network.


What is MSI?
This file is basically use for deploying or installation of any application in the network.


What is MST?
This file is basically using for repairing of any application in the network.


What is zap file?
It is basically use for that application, which do not have the MSI file. We create a text file with zap extension for deploying or installation purpose of any application in the network.


What is ace?
Ace stand for access control entry.


What is bridgehead server?
A bridgehead server is a central point in the site that is responsible for replication from another site.


What is the booting file Of Windows 2000/2003/xp O/s?
NTLDR
NTDETECT.COM
BOOT.INI
 NTBoot SECT.DOS
 NTBOOTDD.SYS
NTOSKRNL.EXE


We will back with more questions.. 

Thanks for your support.