Monday, January 14, 2008

UNIX Tutorial for beginners

UNIX Tutorial for beginners (Table of Contains)

1. What Is UNIX?.................................................................3
1.1 Thekernel...................................................................3
1.2 The standard UilityPgrams............................................3
1.3 The system configuration fles........................................3
2 Accessing a UNIX System...................................................4
2.1 2.1 Console................................................................4
2.2 2.2 Smart terminals....................................................4
2.3 2.3 Remote access......................................................4
3 Logging In and Logging Out................................................5
3.1 Logging in..................................................................5
3.2 Your username...........................................................5
3.3 Your password...........................................................5
3.4 Logging Out...............................................................5
4 The UNIX Shell.................................................................6
4.1 Concept.....................................................................6
4.2 Entering shell commands.............................................7
4.3 Aborting a shell command............................................7
4.4 Special characters in UNIX,..........................................7
4.5 Getting help on UNIX..................................................7
5 Files and Directories.........................................................8
5.1 The UNIX file system structure.....................................8
5.2 File and directory permissions......................................9
5.2.1 A short note on groups:........................................9
5.2.2 The meaning of file and directory permissions..........9
5.2.3 Viewing permissions.............................................9
5.2.4 Setting permissions.............................................10
5.2.5 Changing Directories............................................10
5.2.6 Listing the contents of a directory..........................11
5.2.7 Viewing the contents of a file................................11
5.2.8 Copying files and directories.................................12
5.2.9 Moving and renaming files....................................12
5.2.10 Removing files..................................................13
5.2.11 Creating a directory...........................................13
5.2.12 Removing a directory.........................................13
6 Redirecting Input and Output............................................14
6.1 Redirecting input.......................................................14
6.2 Redirecting output.....................................................14
6.3 Redirecting error.......................................................15
7 Pipelines and Filters.........................................................15
7.1 Concept:..................................................................15
7.2 Grep........................................................................16
8 Examples of Basic Commands...........................................16
Summary of Basic Commands.......................................17
9 The vi Editor...................................................................19
9.1 Basics of vi editor:.....................................................19
9.2 Basic vi keys.............................................................19
10 Networking asics............................................................20
10.1 ifconfig...................................................................20
10.2 ping.......................................................................20
10.3 Netstat...................................................................21
11 Reference......................................................................21

1. What Is UNIX?

UNIX is an operating system. The job of an operating system is to orchestrate the various parts of the computer -- the processor, the on-board memory, the disk drives, keyboards, video monitors, etc. -- to perform useful tasks. The operating system is the master controller of the computer, the glue that holds together all the components of the system, including the administrators, programmers, and users. When you want the computer to do something for you, like start a program, copy a file, or display the contents of a directory, it is the operating system that must perform those tasks for you.
More than anything else, the operating system gives the computer its recognizable characteristics. It would be difficult to distinguish between two completely different computers, if they were running the same operating system. Conversely, two identical computers, running different operating systems, would appear completely different to the user.
UNIX was created in the late 1960s, in an effort to provide a multi-user, multitasking system for use by programmers. The philosophy behind the design of UNIX was to provide simple, yet powerful utilities that could be pieced together in a flexible manner to perform a wide variety of tasks. The UNIX operating system comprises three parts: The kernel, the standard utility programs, and the system configuration files.
1.1 The kernel

The kernel is the core of the UNIX operating system. Basically, the kernel is a large program that is loaded into memory when the machine is turned on, and it controls the allocation of hardware resources from that point forward. The kernel knows what hardware resources are available (like the processor(s), the on-board memory, the disk drives, network interfaces, etc.), and it has the necessary programs to talk to all the devices connected to it.
1.2 The standard utility programs

These programs include simple utilities like cp, which copies files, and complex utilities, like the shell that allows you to issue commands to the operating system.
1.3 The system configuration files

The system configuration files are read by the kernel, and some of the standard utilities. The UNIX kernel and the utilities are flexible programs, and certain aspects of their behavior can be controlled by changing the standard configuration files. One example of a system configuration file is the filesystem table "fstab”, which tells the kernel where to find all the files on the disk drives. Another example is the system log configuration file "syslog.conf", which tells the kernel how to record the various kinds of events and errors it may encounter.
2 Accessing a UNIX System

A UNIX system can be accessed through the following different methods.
2.1 2.1 Console

Every UNIX system has a main console that is connected directly to the machine. The console is a special type of terminal that is recognized when the system is started. Some UNIX system operations must be performed at the console. Typically, the console is only accessible by the system operators, and administrators.
2.2 2.2 Smart terminals

Smart terminals, like the X terminal, can interact with the UNIX system at a higher level. Smart terminals have enough on-board memory and processing power to support graphical interfaces. The interaction between a smart terminal and a UNIX system can go beyond simple characters to include icons, windows, menus, and mouse actions.
2.3 2.3 Remote access

A UNIX system can also be accessed using telnet or ssh from any UNIX/Non-UNIX platforms.

$ telnet
$ ssh
3 Logging In and Logging Out

To ensure security and organization on a system with many users, UNIX machines employ a system of user accounts. The user accounting features of UNIX provide a basis for analysis and control of system resources, preventing any user from taking up more than his or her share, and preventing unauthorized people from accessing the system. Every user of a UNIX system must get permission by some access control mechanism.
3.1 Logging in

Logging in to a UNIX system requires two pieces of information: A username, and a password. When you sit down for a UNIX session, you are given a login prompt that looks like this:
login:
Type your username at the login prompt, and press the return key. The system will then ask you for your password. When you type your password, the screen will not display what you type.
3.2 Your username

Your username is assigned by the person who creates your account. The UNIX system administrator is generally responsible for this. Your username must be unique on the system where your account exists since it is the means by which you are identified on the system.
3.3 Your password

When your account is created, a password is assigned. The first thing you should do is change your password, using the passwd utility. To change your password, type the command
$ passwd
After you have logged in. The system will ask for your old password, to prevent someone else from sneaking up, and changing your password. Then it will ask for your new password. You will be asked to confirm your new password, to make sure that you didn't mistype. It is very important that you choose a good password, so that someone else cannot guess it. Here are some rules for selecting a good password.
3.4 Logging Out

When you're ready to quit, type the command
$ exit
It is always a good idea to clear the display before you log out, you can type the command
$ clear
4 The UNIX Shell

The shell is perhaps the most important program on the UNIX system, from the end-user's standpoint. The shell is your interface with the UNIX system, the middleman between you and the kernel.
4.1 Concept

The shell is a type of program called an interpreter. An interpreter operates in a simple loop: It accepts a command, interprets the command, executes the command, and then waits for another command. The shell displays a "prompt," to notify you that it is ready to accept your command.

The shell recognizes a limited set of commands, and you must give commands to the shell in a way that it understands: Each shell command consists of a command name, followed by command options (if any are desired) and command arguments (if any are desired). The command name, options, and arguments, are separated by blank space.
The shell is a program that the UNIX kernel runs for you. A program is referred to as a process while the kernel is running it. The kernel can run the same shell program (or any other program) simultaneously for many users on a UNIX system, and each running copy of the program is a separate process.
When you execute a non built-in shell command, the shell asks the kernel to create a new sub process (called a "child" process) to perform the command. The child process exists just long enough to execute the command. The shell waits until the child process finishes before it will accept the next command.
Unlike DOS, the UNIX shell is case-sensitive, meaning that an uppercase letter is not equivalent to the same lower case letter (i.e., "A" is not equal to "a"). Most all UNIX commands are lower case.
4.2 Entering shell commands

The basic form of a UNIX command is: commandname [-options] [arguments]
The command name is the name of the program you want the shell to execute. The command options, usually indicated by a dash, allow you to alter the behavior of the command. The arguments are the names of files, directories, or programs that the command needs to access.
The square brackets ([ and ]) signify optional parts of the command that may be omitted.
Example: Type the command
$ ls -l /tmp
The above command displays a long listing of the contents of the /tmp directory. In this example, "ls" is the command name, "-l" is an option that tells ls to create a long, detailed output, and "/tmp" is an argument naming the directory that ls is to list.
4.3 Aborting a shell command

Most UNIX systems will allow you to abort the current command by typing Control-C. To issue a Control-C abort, hold the control key down, and press the "c" key.
4.4 Special characters in UNIX,

UNIX recognizes certain special characters as command directives. If you use one of the UNIX special characters in a command, make sure you understand what it does. The special characters are: / < > ! $ % ^ & * | { } ~ and ;
When creating files and directories on UNIX, is is safest to only use the characters A-Z, a-z, 0-9, and the period, dash, and underscore characters.
4.5 Getting help on UNIX

To access the on-line manuals, use the man command, followed by the name of the command you need help with.
Example: Type
$ man ls
to see the manual page for the "ls" command. To get help on using the manual, type

$ man man
to the UNIX shell.
5 Files and Directories


All the stored information on a UNIX computer is kept in a filesystem. Any time you interact with the UNIX shell, the shell considers you to be located somewhere within a filesystem. Although it may seem strange to be "located" somewhere in a computer's filesystem, the concept is not so different from real life. After all, you can't just be, you have to be somewhere. The place in the filesystem tree where you are located is called the current working directory.
5.1 The UNIX file system structure

The UNIX filesystem is hierarchical (resembling a tree structure). The tree is anchored at a place called the root, designated by a slash "/". Every item in the UNIX filesystem tree is either a file, or a directory. A directory is like a file folder. A directory can contain files, and other directories. A directory contained within another is called the child of the other. A directory in the filesystem tree may have many children, but it can only have one parent. A file can hold information, but cannot contain other files, or directories.

To describe a specific location in the filesystem hierarchy, you must specify a "path." The path to a location can be defined as an absolute path from the root anchor point, or as a relative path, starting from the current location. When specifying a path, you simply trace a route through the filesystem tree, listing the sequence of directories you pass through as you go from one point to another. Each directory listed in the sequence is separated by a slash.
UNIX provides the shorthand notation of "." to refer to the current location, and ".." to refer to the parent directory.
5.2 File and directory permissions

UNIX supports access control. Every file and directory has associated with it ownership, and access permissions. Furthermore, one is able to specify those to whom the permissions apply. Permissions are defined as read, write, and execute. The read, write, and execute permissions are referred to as r, w, and x, respectively.
Those to whom the permissions apply are the user who owns the file, those who are in the same group as the owner, and all others. The user, group, and other permissions are referred to as u, g, and o, respectively.
5.2.1 A short note on groups:

UNIX allows users to be placed in groups, so that the control of access is made simpler for administrators.
5.2.2 The meaning of file and directory permissions

• Read permission

For a file, having read permission allows you to view the contents of the file. For a directory, having read permission allows you to list the directory's contents.
• Write permission

For a file, write permission allows you to modify the contents of the file. For a directory, write permission allows you to alter the contents of the directory, i.e., to add or delete files.
• Execute permission

For a file, execute permission allows you to run the file, if it is an executable program, or script. Note that file execute permission is irrelevant for no executable files. For a directory, execute permission allows you to cd to the directory, and make it your current working directory.
5.2.3 Viewing permissions

To see the permissions on a file, use the ls command, with the -l option.
Example: Execute the command
$ ls -l /etc/passwd
to view the information on the system password database. The output should look similar to this:
-rw-r--r-- 1 root sys 41002 Apr 17 12:05 /etc/passwd
The first 10 characters describe the access permissions. The first dash indicates the type of file (d for directory, s for special file, - for a regular file). The next three characters ("rw-") describe the permissions of the owner of the file: read and write, but no execute. The next three characters ("r--") describe the permissions for those in the same group as the owner: read, no write, no execute. The next three characters describe the permissions for all others: read, no write, no execute.
5.2.4 Setting permissions

UNIX allows you to set the permissions on files that you own. The command to change the file permission mode is chmod, chmod requires you to specify the new permissions you want, and specify the file or directory you want the changes applied to.
To set file permissions, you may use to the "rwx" notation to specify the type of permissions, and the "ugo" notation to specify those the permissions apply to.
To define the kind of change you want to make to the permissions, use the plus sign (+) to add a permission, the minus sign (-) to remove permission, and the equal sign (=) to set permission directly.
Example: Type the command
$ chmod g=rw- ~/.bash_history
to change the file permissions on the file . bash_history, in your home directory. Specifically, you are specifying group read access and write access, with no execute access.
5.2.5 Changing Directories

In UNIX, your location in the filesystem hierarchy is known as your "current working directory." When you log in, you are automatically placed in your "home directory." To see where you are, type the command

$ pwd
which stands for "print working directory."
To change your location in the filesystem hierarchy, use the cd (change directory) command, followed by an argument defining where you want to go. The argument can be either an absolute path to the destination, or a relative path.
Example: Type the command
$ cd /tmp
to go to the /tmp directory. You can type
$ pwd
to confirm that you're actually there. If you type the cd command without an argument, the shell will place you in your home directory.
5.2.6 Listing the contents of a directory

The ls command allows you to see the contents of a directory, and to view basic information (like size, ownership, and access permissions) about files and directories. The ls command has numerous options, so see the manual page on ls (type man ls) for a complete listing. The ls command also accepts one or more arguments. The arguments can be directories, or files.
Example: Type the command
$ ls -la /etc/i*
to the UNIX shell. For more details on ls command please refer to ls man pages.

5.2.7 Viewing the contents of a file

Text files are intended for direct viewing, and other files are intended for computer interpretation. The UNIX file command allows you to determine whether an unknown file is in text format, suitable for direct viewing.
Exmple: Type the command
$ file /bin/sh
to see what kind of file the shell is.
• The cat command

The cat command concatenates files and sends them to the screen. You can specify one or more files as arguments. Cat makes no attempt to format the text in any way, and long output may scroll off the screen before you can read it.
Example: Send the contents of your .profile file to the screen by typing
$ cat ~/.profile
to the shell. The tilde character (~) is UNIX shorthand for your home directory.
• The more command

The more command displays a text file, one screen full at a time. You can scroll forward a line at a time by pressing the return key, or a screen full at a time by pressing the spacebar. You can quit at any time by pressing the q key.
Example: Type
$ more /etc/rc.d/rc.sysinit
to the shell. Scroll down by pressing return, and by pressing the spacebar. Stop the more command from displaying the rest of the file by typing q.
• The head and tail commands

The head command allows you to see the top part of a file. You may specify the number of lines you want, or default to ten lines.
Example: Type
$ head -15 /etc/rc.d/rc.sysinit
to see the first fifteen lines of the /etc/rc.d/rc.sysinit file.
The tail command works like head, except that it shows the last lines of of file.
EXAMPLE: Type
$ tail etc/rc.d/rc.sysinit
to see the last ten lines of the file /etc/rc. Because we did not specify the number of lines as an option, the tail command defaulted to ten lines.
5.2.8 Copying files and directories

The UNIX command to copy a file or directory is cp. The basic cp command syntax is
$ cp source destination.
Example: The command
$ cp ~/.bash_profile ~/pcopy
makes a copy of your .bash_profile file, and stores it in a file called "pcopy" in your home directory.
EXERCISE: Describe the permissions necessary to successfully execute the command in the previous example.
5.2.9 Moving and renaming files

The UNIX mv command moves files and directories. You can move a file to a different location in the filesystem, or change the name by moving the file within the current location.
Example: The command
$ mv ~/pcopy ~/qcopy
takes the pcopy file you created in the cp exercise, and renames it "qcopy".
5.2.10 Removing files

The rm command is used for removing files and directories. The syntax of the rm command is rm filename. You may include many filenames on the command line.
Example: Remove the qcopy file that you placed in your home directory in the section on moving files by typing
$ rm ~/qcopy
5.2.11 Creating a directory

The UNIX mkdir command is used to make directories. The basic syntax is mkdir directoryname. If you do not specify the place where you want the directory created (by giving a path as part of the directory name), the shell assumes that you want the new directory placed within the current working directory.
Example: Create a directory called foo within your home directory by typing
$ mkdir ~/foo
5.2.12 Removing a directory

The UNIX rmdir command removes a directory from the filesystem tree. The rmdir command does not work unless the directory to be removed is completely empty. The rm command, used with the -r option can also be used to remove directories. The rm -r command will first remove the contents of the directory, and then remove the directory itself.
Example: You could enter the commands
$ rmdir ~/foo/bar; rmdir ~/foo
$ rm -r ~/foo


6 Redirecting Input and Output

Every program you run from the shell opens three files: Standard input, standard output, and standard error. The files provide the primary means of communications between the programs, and exist for as long as the process runs. The standard input file provides a way to send data to a process. As a default, the standard input is read from the terminal keyboard. The standard output provides a means for the program to output data. As a default, the standard output goes to the terminal display screen. The standard error is where the program reports any errors encountered during execution. By default, the standard error goes to the terminal display.
6.1 Redirecting input

Using the "less-than" sign with a file name like this:
< file1
in a shell command instructs the shell to read input from a file called "file1" instead of from the keyboard.
Example: Use standard input redirection to send the contents of the file /etc/passwd to the more command:
$ more < /etc/passwd
Many UNIX commands that will accept a file name as a command line argument, will also accept input from standard input if no file is given on the command line.
Example: To see the first ten lines of the /etc/passwd file, the command:
$ head /etc/passwd
will work just the same as the command:
$ head < /etc/passwd
6.2 Redirecting output

Using the "greater-than" sign with a file name like this:
> file2
causes the shell to place the output from the command in a file called "file2" instead of on the screen. If the file "file2" already exists, the old version will be overwritten.
Example: Type the command
$ ls /tmp > ~/ls.out
to redirect the output of the ls command into a file called "ls.out" in your home directory. Remember that the tilde (~) is UNIX shorthand for your home directory. In this command, the ls command will list the contents of the /tmp directory.
Use two "greater-than" signs to append to an existing file. For example:
>> file2
causes the shell to append the output from a command to the end of a file called "file2". If the file "file2" does not already exist, it will be created.
Example: In this example, I list the contents of the /tmp directory, and put it in a file called myls. Then, I list the contents of the /etc directory, and append it to the file myls:
ls /tmp > myls ls /etc >> myls
6.3 Redirecting error

Redirecting standard error is a bit trickier, depending on the kind of shell you're using (there's more than one flavor of shell program!). In the POSIX shell and ksh, redirect the standard error with the symbol "2>".
Example: Sort the /etc/passwd file, place the results in a file called foo, and trap any errors in a file called err with the command:
$ sort < /etc/passwd > foo 2> err

7 Pipelines and Filters
7.1 Concept:


UNIX allows you to connect processes, by letting the standard output of one process feed into the standard input of another process. That mechanism is called a pipe. Connecting simple processes in a pipeline allows you to perform complex tasks without writing complex programs.
Example: Using the more command, and a pipe, send the contents of your .profile and .shrc files to the screen by typing
$ cat .profile .shrc | more
to the shell. The following command uses head and tail in a pipeline to display lines 25 through 75 of a file.
$ cat file | head -75 | tail -50
7.2 Grep

The grep utility is one of the most useful filters in UNIX. Grep searches line-by-line for a specified pattern, and outputs any line that matches the pattern. The basic syntax for the grep command is grep [-options] pattern [file]. If the file argument is omitted, grep will read from standard input. It is always best to enclose the pattern within single quotes, to prevent the shell from misinterpreting the command.
The grep utility recognizes a variety of patterns, and the pattern specification syntax was taken from the vi editor. Here are some of the characters you can use to build grep expressions:
• The carat (^) matches the beginning of a line.
• The dollar sign ($) matches the end of a line.
• The period (.) matches any single character.
• The asterisk (*) matches zero or more occurrences of the previous character.
• The expression [a-b] matches any characters that are lexically between a and b.

Example: Type the command
$ grep 'jon' /etc/passwd
to search the /etc/passwd file for any lines containing the string "jon".
Type the command
$grep '^jon' /etc/passwd
to see the lines in /etc/passwd that begin with the character string "jon".

$ls -l /tmp | grep 'root'
List all the files in the /tmp directory owned by the user root.

8 Examples of Basic Commands



Action Command Examples
Append to file cat >> cat >> file1
Combine 2 files cat cat file1 file2 > file3
Copy files cp cp myfile copymyfile
Create a file cat cat > newfile
Edit files vi vi file
List files ls ls bin/
Move a file mv mv file1 doc/chapter1
Remove a file rm rm unwantedfile
Rename a file mv mv oldfilename newfilename
View files cat pg more less view cat file pg file2 file3 view file6 file7

Directories Command Examples
Change to another directory cd cd example/first/
Create a directory mkdir mkdir example1
Find out where you are pwd pwd
Go to your home directory cd cd
Remove an empty directory rmdir rmdir junk

Redirection of Output or Input > redirects the output of a command to a file >> redirects the output of a command to the end of an existing file < takes the input of a command form a file, not the terminal
Summary of Basic Commands
• apropos locate commands by keyword lookup
• arch display the architecture of the current host
• cal display a calendar cal [month] year
o month number between 1 and 12
o year number between 1 and 9999

Examples: cal 1996 print calendar for year 1996 cal 1 1997 print calendar for January 1997
• cancel send/cancel requests to an LP print service
• cat concatenate and display files (To view files, create files, append to files and combine files) cat [options] [files] Examples: cat files read file(s) cat > file create file (reads form terminal; terminate input with ^D) cat >> file append to file (reads form terminal; terminate input with ^D) cat file2 >> file1 appends contents of file2 to file1
• cd shell built-in functions to change the current working directory
• chdir shell built-in functions to change the current working directory
• chgrp change the group ownership of a file
• chmod change the permissions mode of a file
• chown change owner of file
• clear clear the terminal screen
• cp copy files
• date print and set the date
• dc arbitrary precision desktop calculator
• dos2unix convert text file from DOS format to ISO format
• eject eject media such as CD-ROM and floppy from drive
• exit shell built-in functions to enable the execution of the shell to advance beyond its sequence of steps
• file determine the type of a file by examining its contents
• head display first few lines of files
• lp send/cancel requests to an LP print service
• lpstat print information about the status of the LP print service
• ls list the contents of a directory ls [options] [directories] the current working directory used if no directories specified A few options:
o -a list all entries includeing hidden files (starting with .)
o -i print inode numbers
o -l long list (mode, links, owner, group, size, timeof last modification, and name
o -t sort by modification time
o -x multi-column list, sorted across each row
• Mail, mailx, mail, rmail interactive message processing system to read mail or send mail to users mail [options] users Examples: mail with no options, to read your mail mail user to send mail to user mail user < filename mail a file to another user
• mkdir make directories
• more browse or page through a text file
• mv move files
• nispasswd change NIS+ password information
• page browse or page through a text file
• pg files perusal filter for CRTs
• pr print files
• ps display the status of current processes
• pwd working directory name
• rm remove files or directories
• rmdir remove files or directories
• spell find spelling errors
• tail deliver the last part of a file
• umask shell built-in function to restrict read/write/execute permissions
• unix2dos convert text file from ISO format to DOS format
• vi screen-oriented (visual) display editor based on ex
• view screen-oriented (visual) display editor based on ex
• w who is logged in, and what are they doing
• wc display a count of lines, words and characters in a file
• which locate a command; display its pathname or alias
• who who is on the system
• whoami display the effective current username
• whois Internet user name directory service
• write write to another user

9 The vi Editor


Vi (visual) is a display oriented interactive text editor, probable the most widely used text editor in UNIX world. When using vi the screen of your terminal acts as a window into the file which you are editing. Changes, which you make to the file, are reflected in what you see.
9.1 Basics of vi editor:

Vi operates in two modes 2 (insert and command) in order to determine which function should be performed when a key is pressed. To start vi just type vi at the command prompt.
$ vi file_name
You will see the text of the file you included. Vi is now in command mode. The most basic command to enter insert mode is pressing i, which lets you insert text to the left of the cursor. The escape key () takes you out of insert mode and back to the command mode. If you are ever in doubt about what mode you are in, just press a few times until vi starts complaining. You will then know that you are in the command mode.
9.2 Basic vi keys

Delete a character: x
Delete a line: dd
Delete n lines: ndd (Where n is any number)
Copy a line: yy
Copy n lines: nyy (Where n is any number)
Paste a line: p
Beginning of file: :0
End of file: Shift + g
Beginning of line: 0
End of a line: $
Change word: cw
Repeat last executed task: .
Find a word: /
Find again: n
Save: w
Save As: w
Save and exit: wq
Quit without save: q!

10 Networking Basics


10.1 ifconfig

The "ifconfig" command allows the operating system to setup network interfaces and allow the user to view information about the configured network interfaces.

To view the network settings on the first Ethernet adapter installed in the computer you can use the following command.
$ ifconfig eth0
$ ifconfig
to display all network interface settings including the loopback interface.

# ifconfig eth0 down
brings the eth0 (1st Ethernet interface) down on your UNIX system. We have used ‘#’ as command prompt here, because only ‘root’ can do this.

# ifconfig eth0 up
Activates the network interface.

10.2 ping

Ping stands for “Packet InterNet Groper". Ping sends ICMP ECHO_REQUEST packets to network hosts.

Example:

$ ping computerhope.com

Would ping the host computerhope.com to see if it is alive.
Note: Many ISP's are disabling the ping command in helping to prevent possible Denial Of Service attacks. In addition some commands may not be available or results may vary when pinging a host.

10.3 Netstat

The netstart command in UNIX shows the network status.

Example:
$ netstat
displays generic net statistics of the host you are currently connected to.

$netstat –t
Shows active tcp connections on your UNIX systems.

11 Reference
1. www.linux.org
2. www.linux-docs.org
3. www.computerhope.com/unix.htm
4. www.xfree86.org
5. Unix/Linux man pages

No comments: