<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7521144173919293619</id><updated>2012-02-16T05:08:10.995-08:00</updated><category term='Usefull commands'/><title type='text'>Need Help with Unix?</title><subtitle type='html'>Welcome to Help-Unix Blog. We pride ourselves in being the place where people come for UNIX help.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-1569419152941729225</id><published>2007-07-27T12:19:00.000-07:00</published><updated>2007-07-27T12:24:42.654-07:00</updated><title type='text'>Adding a service , script to startup on linux</title><content type='html'>This small FAQ explain how to make linux start certain service or self made program at the boot time.&lt;br /&gt;&lt;br /&gt;Step 1:&lt;br /&gt;Edit /etc/rc.local&lt;br /&gt;&lt;br /&gt;This script will hold your personal initialization instructions which will be loaded after all other programs are loaded.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# This script will be executed *after* all the other init scripts.&lt;br /&gt;# You can put your own initialization stuff in here if you don't&lt;br /&gt;# want to do the full Sys V style init stuff.&lt;br /&gt;&lt;br /&gt;touch /var/lock/subsys/local&lt;br /&gt;&lt;br /&gt;/usr/local/apache/bin/apachectl&lt;br /&gt;startsslecho Starting Apache ... Felo&lt;br /&gt;&lt;br /&gt;service sendmail start&lt;br /&gt;echo Starting Sendmail&lt;br /&gt;&lt;br /&gt;I do hope its usefull , its simple but not everybody knows it right ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-1569419152941729225?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/1569419152941729225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=1569419152941729225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/1569419152941729225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/1569419152941729225'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/adding-service-script-to-startup-on.html' title='Adding a service , script to startup on linux'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-7060055306153897948</id><published>2007-07-27T12:00:00.000-07:00</published><updated>2007-07-27T12:12:29.877-07:00</updated><title type='text'>Installing an SSL Aware APACHE server</title><content type='html'>This basic instructions to install an ssl apache server on linux are not for the faint of heart (hehehe) , i say that cause basically you need common sense and preferably some unix experience to not make mistakes on the installation, ive made dozens on installations like this, and in some cases new unknown issues appear from time to time. But overall, this steps are the normal ones to follow to compile apache from scratch&lt;br /&gt;&lt;br /&gt;Good luck&lt;br /&gt;&lt;br /&gt;=====================================&lt;br /&gt;Installing an ssl aware apache server by unixhelper&lt;br /&gt;=====================================&lt;br /&gt;&lt;br /&gt;[Step1]&lt;br /&gt; Download openssl (www.openssl.org) and modssl (www.modssl.org) You will need the latest 1.3.X apache server from &lt;a href="http://www.apache.org/"&gt;www.apache.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;[Step2]&lt;br /&gt;Build and make openssl&lt;br /&gt;&lt;br /&gt;Create a folder with the name of the openssl package downloaded and cd into it , dont forget to decompress the openssl package into the folder (common sense)&lt;br /&gt;&lt;br /&gt;$ cd openssl-0.9.7x (being x the version of the openssl package downloaded of course)&lt;br /&gt;$ ./config (the openssl source package file should be decompressed into this folder already of course)&lt;br /&gt;$ make&lt;br /&gt;$ make install&lt;br /&gt;$ cd ..&lt;br /&gt;&lt;br /&gt;[Step3]&lt;br /&gt;Now we create a modssl folder, and decompress the source package file into this folder, cd into it and run the configure command below (use common sense)&lt;br /&gt;&lt;br /&gt;$ cd mod_ssl-2.8.16-1.3.29&lt;br /&gt;&lt;br /&gt;$ ./configure --with-apache=../apache_1.3.X --with-ssl=../openssl-0.9.7X --prefix=/usr/local/apache&lt;br /&gt;&lt;br /&gt;Now go into the apache folder (which should already have the apache source package decompressed into it)&lt;br /&gt;&lt;br /&gt;$ cd ..&lt;br /&gt;$ cd apache_1.3.X&lt;br /&gt;&lt;br /&gt;[Step3]&lt;br /&gt;&lt;br /&gt;$ CFLAGS=-DEAPI SSL_BASE=/openssl_package_folder_path/openssl-0.9.7x&lt;br /&gt;&lt;br /&gt;$ ./configure --prefix=/usr/local/apache --enable-module=ssl=../openssl-0.9.7x --enable-module=all --enable-shared=max&lt;br /&gt;&lt;br /&gt;make&lt;br /&gt;make certificate&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;create the self signed certificate and then start apache from: /usr/local/apache/bin/apachectl startssl&lt;br /&gt;&lt;br /&gt;People , please understand this WILL NOT work if you dont use common sense on changind the paths &amp; file names properly, thats why I said these instructions are for medium/advanced users. Thank me later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-7060055306153897948?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/7060055306153897948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=7060055306153897948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7060055306153897948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7060055306153897948'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/installing-ssl-aware-apache-server.html' title='Installing an SSL Aware APACHE server'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-2315243822875297678</id><published>2007-07-27T11:50:00.000-07:00</published><updated>2007-07-27T11:58:52.573-07:00</updated><title type='text'>Adding Linux Swap Space</title><content type='html'>&lt;strong&gt;Adding Swap Space&lt;/strong&gt;&lt;br /&gt;Sometimes it is necessary to add more swap space after installation. For example, you may upgrade the amount of RAM in your system from 64 MB to 128 MB, but there is only 128 MB of swap space. It might be advantageous to increase the amount of swap space to 256 MB if you perform memory-intense operations or run applications that require a large amount of memory.&lt;br /&gt;&lt;br /&gt;You have two options: add a swap partition or add a swap file. It is recommended that you add a swap partition, but sometimes that is not easy if you do not have any free space available.&lt;br /&gt;&lt;br /&gt;To add a swap partition (assuming /dev/hdb2 is the swap partition you want to add):&lt;br /&gt;&lt;br /&gt;The hard drive can not be in use (partitions can not be mounted, and swap space can not be enabled). The easiest way to achieve this it to boot your system in rescue mode. Refer to Chapter 8 for instructions on booting into rescue mode. When prompted to mount the filesystem, select Skip.&lt;br /&gt;&lt;br /&gt;Alternately, if the drive does not contain any partitions in use, you can unmount them and turn off all the swap space on the hard drive with the swapoff command.&lt;br /&gt;&lt;br /&gt;Create the swap partition using parted or fdisk. Using parted is easier than fdisk; thus, only parted will be explained. To create a swap partition with parted:&lt;br /&gt;&lt;br /&gt;At a shell prompt as root, type the command parted /dev/hdb, where /dev/hdb is the device name for the hard drive with free space.&lt;br /&gt;&lt;br /&gt;At the (parted) prompt, type print to view the existing partitions and the amount of free space. The start and end values are in megabytes. Determine how much free space is on the hard drive and how much you want to allocate for a new swap partition.&lt;br /&gt;&lt;br /&gt;At the (parted) prompt, type mkpartfs part-type linux-swap start end, where part-type is one of primary, extended, or logical, start is the starting point of the partition, and end is the end point of the partition.&lt;br /&gt;&lt;br /&gt;Warning &lt;br /&gt;Changes take place immediately; be careful when you type.&lt;br /&gt;&lt;br /&gt;Exit parted by typing quit.&lt;br /&gt;&lt;br /&gt;Now that you have the swap partition, use the command mkswap to setup the swap partition. At a shell prompt as root, type the following:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;mkswap /dev/hdb2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;To enable the swap partition immediately, type the following command:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;swapon /dev/hdb2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;To enable it at boot time, edit /etc/fstab to include:&lt;br /&gt;&lt;br /&gt;/dev/hdb2               swap                    swap    defaults        0 0&lt;br /&gt;&lt;br /&gt;The next time the system boots, it will enable the new swap partition.&lt;br /&gt;&lt;br /&gt;After adding the new swap partition and enabling it, make sure it is enabled by viewing the output of the command cat /proc/swaps or free.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;To add a swap file:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Determine the size of the new swap file and multiple by 1024 to determine the block size. For example, the block size of a 64 MB swap file is 65536.&lt;br /&gt;&lt;br /&gt;At a shell prompt as root, type the following command with count being equal to the desired block size:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;dd if=/dev/zero of=/swapfile bs=1024 count=65536&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Setup the swap file with the command:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;mkswap /swapfile&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;To enable the swap file immediately but not automatically at boot time:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;swapon /swapfile&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;To enable it at boot time, edit /etc/fstab to include:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/swapfile               swap                    swap    defaults        0 0&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;The next time the system boots, it will enable the new swap file.&lt;br /&gt;&lt;br /&gt;After adding the new swap file and enabling it, make sure it is enabled by viewing the output of the command cat /proc/swaps or free.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-2315243822875297678?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/2315243822875297678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=2315243822875297678' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2315243822875297678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2315243822875297678'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/adding-linux-swap-space.html' title='Adding Linux Swap Space'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-8103478560713318462</id><published>2007-07-27T11:47:00.000-07:00</published><updated>2007-07-27T11:49:52.544-07:00</updated><title type='text'>Kill Child Process</title><content type='html'>Now this is an usefull and simple command, have you ever had a situation where you are programming socket daemons, or just any process in itself that could create several uncontrolled childs ?&lt;br /&gt;&lt;br /&gt;Obviously killing the whole shell would fix the problem, but that quite savage , lets say you have several php childs running on the background and you want to kill them without killing php.&lt;br /&gt;&lt;br /&gt;The following command will do the job:    kill -9 'pidof php'&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Notice&lt;/strong&gt;: The "-9" option is the most severe kill option available&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-8103478560713318462?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/8103478560713318462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=8103478560713318462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/8103478560713318462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/8103478560713318462'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/kill-child-process.html' title='Kill Child Process'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-7766038986669663170</id><published>2007-07-27T11:39:00.000-07:00</published><updated>2007-07-27T11:47:43.889-07:00</updated><title type='text'>Using awk to analyze logs</title><content type='html'>AWK is a neat tool that comes in most *nix OS environments, basically on this small article I show you how to use awk to analyze a log file like an access_log from apache or even a sendmail log file. This can be really usefull to analyze big log files and find in some cases, someone hammering your server with hyge traffic (DoS Attack)&lt;br /&gt;What is AWK ?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;awk Command&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Definition:&lt;/strong&gt; awk is a powful Unix command. It allows the user to manipulate files that are structured as columns of data and strings.&lt;br /&gt;&lt;br /&gt;Once you understand the basics of awk you will find that it is surprisingly useful. You can use it to automate things in ways you have never thought about. It can be used for data processing and for automating the application of Unix commands. It also has many spreadsheet-type functionalities.&lt;br /&gt;&lt;br /&gt;There are two ways to run awk. A simple awk command can be run from the command line. More complex tasks should be written as awk programs ("scripts") to a file. Examples of each are provided below.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt; % awk 'pattern {action}' input-file &gt; output-file&lt;br /&gt;&lt;br /&gt;meaning: take each line of the input file; if the line contains the pattern apply the action to the line and write the resulting line to the output-file.&lt;br /&gt;&lt;br /&gt;If the pattern is omitted, the action is applied to all lines:&lt;br /&gt;&lt;br /&gt;% awk '{action}' input-file &gt; output-file&lt;br /&gt;&lt;br /&gt;By default, awk works on files that have columns of numbers or strings that are separated by white space (tabs or spaces), but the -F option can be used if the columns are separated by another character. awk refers to the first column as $1, the second column as $2, etc. The whole line referred to as $0.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Back to my example&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Lets say we want to find the amount of times an specific ip address has hit your webserver,&lt;br /&gt;&lt;br /&gt;on this example we are assuming your apache access_log is located in /usr/local/apache/logs&lt;br /&gt;&lt;br /&gt;The full command would be:&lt;br /&gt;&lt;br /&gt;awk '{print $1}'&lt;br /&gt;&lt;br /&gt;This small command is really powerfull, give it a try!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-7766038986669663170?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/7766038986669663170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=7766038986669663170' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7766038986669663170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7766038986669663170'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/using-awk-to-analyze-logs.html' title='Using awk to analyze logs'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-7797196544166927498</id><published>2007-07-26T01:42:00.000-07:00</published><updated>2007-07-26T02:24:46.332-07:00</updated><title type='text'>Using NMAP TOOL</title><content type='html'>&lt;strong&gt;Fumbling toward a hacker's-eye view of your network&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ready to see your network the way an attacker sees it?&lt;br /&gt;&lt;br /&gt;This short series is for the network administrator who has a grasp of networking, but knows less about security. You might be the Natalie in Natalie's Graphic Design, or the all-in-one IT department / PC help desk / Webmaster. Maybe you haven't used command line tools before. But if your network has more than nine devices, you can no longer hold your network in your head. You need a way to quickly and reliably find out:&lt;br /&gt;&lt;br /&gt;*How many computers do I have on my network, and what are their IP addresses?&lt;br /&gt;&lt;br /&gt;*What network services (distinguished by open &lt;a href="https://www.watchguard.com/archive/showhtml.asp?pack=135090"&gt;ports&lt;/a&gt;) does each computer offer?&lt;br /&gt;&lt;br /&gt;*What operating system (OS) runs on each computer?&lt;br /&gt;&lt;br /&gt;Answering these questions is known as enumeration, or mapping your network. Enumeration is the first thing a savvy attacker does when trying to take over your network -- so you might as well beat 'em to the punch. Enumerating your network helps you identify and close unnecessary services, improving your security. It also tells you what kinds of OS and applications you're running, so that you can keep up with the proper security patches.&lt;br /&gt;&lt;br /&gt;Enter the port scanner, a special network-mapping tool that quickly and easily answers all three of these questions for you. Port scanners come in many flavors and prices, but in essence, a scanner sends an avalanche of packets to an IP address (or IP addresses) in order to learn which IPs are active, what ports each IP listens on, and (in some cases) what OS each IP uses. Then the scanner reports the results to you.&lt;br /&gt;&lt;br /&gt;Nmap, short for Network Mapper, is one of the most popular and powerful port scanners on the market. Fyodor, a well-respected white hat hacker, originally created Nmap. Since its inception, many security experts have built upon Fyodor's open source tool, making it one of the most powerful and advanced port scanners around.&lt;br /&gt;&lt;br /&gt;So how much does all this technology and power cost you? Nothing. All you need is the courage to download and install it... and a little bit of know-how, which we intend to provide in this three-part series.&lt;br /&gt;&lt;br /&gt;Ready to get your hands dirty, and find out what's really happening on your network? Read on!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Getting and Installing Nmap&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Procuring nmap is easier than saying "procuring." Just go to Fyodor's &lt;a href="http://www.insecure.org/nmap"&gt;Nmap web site&lt;/a&gt; and look for a link labeled Download, which is near both the top and the bottom of the page. Grab the latest copy of the Nmap Windows installer. When we published this article, it was &lt;a href="http://download.insecure.org/nmap/dist/nmap-4.20-setup.exe"&gt;http://download.insecure.org/nmap/dist/nmap-4.20-setup.exe&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once you've downloaded the Nmap Windows installer, you should have a file called Nmap-4.20-setup.exe in whatever directory you downloaded the file to. Double-click on this file to begin installing it. After running the installer, Nmap's End-User's License Agreement (EULA) window pops up. Read this agreement. If you choose to accept it, click &lt;strong&gt;I Accept&lt;/strong&gt;. (If you don't accept the agreement, you can't use Nmap.)&lt;br /&gt;&lt;br /&gt;After you accept its EULA, Nmap's installer presents you with a Components window. Here you can choose which parts of Nmap to install. Since you pretty much need all its components -- and the installer enables them all by default -- simply click &lt;strong&gt;Next&lt;/strong&gt; to continue.&lt;br /&gt;&lt;br /&gt;Now the installer will ask you where you want to install Nmap. We suggest you let it install into its default directory (c:\Program Files\nmap). Just click&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Install.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Finally, the Nmap installer begins to install Nmap onto your computer. However, during this installation process it also has to install WinPcap, a little utility that helps Nmap do its job. When this happens, you'll see a window appear for the WinPcap Installer. Click &lt;strong&gt;Next&lt;/strong&gt;. Again you'll have to read a EULA. If you choose to accept it, click &lt;strong&gt;I Agree&lt;/strong&gt;. After you agree to its EULA, WinPcap installs itself. When it finishes installing, click the Finish button in the WinPcap Installer window. Finally, click &lt;strong&gt;Close&lt;/strong&gt; in the Nmap Setup Window to complete your Nmap installation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Opening the Nmap Command Line&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Nmap is a command line utility. This is where you experience hackery goodness, because instead of mouse-clicking on icons like a mainstream office worker, you type commands like the few, the proud, the l33t old-sk00l coders. Here's how.&lt;br /&gt;&lt;br /&gt;First, open the command prompt on your Windows computer. Click &lt;strong&gt;Start&lt;/strong&gt; =&gt; &lt;strong&gt;Run&lt;/strong&gt;. In the dialog box labeled &lt;strong&gt;Open&lt;/strong&gt;, type cmd. Press &lt;strong&gt;Enter&lt;/strong&gt;. Voila! Meet the command line, left over from the days when Windows was based on the antique Disk Operating System (DOS).&lt;br /&gt;&lt;br /&gt;You should see something blinking, in front of some odd characters like these:&lt;br /&gt;&lt;br /&gt;C:\&gt;&lt;br /&gt;&lt;br /&gt;The letter refers to various drives (real and virtual) on your system. If you see any letter of the alphabet other than C, type C: and press &lt;strong&gt;Enter&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;If you followed the installation defaults, you just installed Nmap into your c:\Program Files\nmap directory. To run Nmap, you must first navigate to that directory. So, type cd\program files\nmap and press Enter. WHen you use the command line, syntax is always critical. Note the backwards slash, and the space between "program" and "files."&lt;br /&gt;&lt;br /&gt;You are now poised to unleash Nmap's power on your network. Which we will do tomorrow, in Part 2. ##&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Part 2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;In Part 1 of this series, we introduced you to network scanners in general, and an excellent free one in particular, Nmap. You also learned how to obtain and install Nmap. Here in Part 2, you'll use Nmap to find out how many devices are active on your network. In Part 3, tomorrow, you'll try your first network scan, and we'll explain how to interpret the results.&lt;br /&gt;&lt;br /&gt;This series assumes you have mastered basic concepts of networking, but do not have a lot of experience managing network security. To understand what follows, you should have a working grasp of IP addresses, subnet masks, and slash notation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Getting Oriented on Your Own Network&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you're going to scan your whole network at once -- and you are! -- you need to know your network IP address, a single address that represents your entire network..&lt;br /&gt;&lt;br /&gt;You can learn your network IP address easily using the command line. If you don't have your DOS prompt open, access it now (and if you don't know how to, refer to the last paragraphs of Part 1). At the blinking prompt, type ipconfig and press Enter. Your results will differ from ours in the details, but will look generally like this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C:\Program Files\Nmap&gt;ipconfig &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Windows IP Configuration &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Ethernet adapter Wireless Network Connection 3: &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Connection-specific DNS Suffix . :&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;IP Address. . . . . . . . . . . . : 192.168.111.34 &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Subnet Mask . . . . . . . . . . . : 255.255.255.0 &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Default Gateway . . . . . . . . . : 192.168.39.14&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C:\Program Files\Nmap&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;If you or your predecessor originally designed your network using the most common subnet masks such as 255.255.255.0 (in slash notation, /24), 255.255.0.0 (/16), or 255.0.0.0 (/8), it's easy to figure out your network's IP address, since it will always end in zero. For instance, based on the sample IPCONFIG above, you know our test computer has a 192.168.111.34 address and a 255.255.255.0 or /24 subnet mask. That subnet mask indicates that the first three octets of an address designate the network. We also just mentiond that the most common subnets, such as /24, always end in a zero for the network address. So the network address of our sample computer is 192.168.111.0/24.&lt;br /&gt;&lt;br /&gt;However, when you subdivide networks into smaller pieces using less common subnet masks, it's more difficult to find your network address without knowing how subnet masking works on a &lt;a href="https://www.watchguard.com/archive/showhtml.asp?pack=135183"&gt;binary level &lt;/a&gt;. The network address won't always end in zero, so then you have to calculate it. Don't worry, though; we have a trick that will tell you your network IP address without any calculation at all.&lt;br /&gt;&lt;br /&gt;Using the command prompt, the ROUTE command actually lists every network route on your computer. It's intended to help you figure out how your computer reaches other networks, but that's not how you'll use it today. Besides having routes to other networks, your computer also has a route to your own local network. Your computer creates this route using your local network IP address. So, we'll use the ROUTE command to display the routes to your local network, and in that way, see your network IP address.&lt;br /&gt;&lt;br /&gt;In the command prompt, type:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;route print 192*&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If appropriate, eplace the "192" with the first octet of your own computer's IP address (which you learned from your IPCONFIG results). Then press &lt;strong&gt;Enter&lt;/strong&gt;. Your results should resemble &lt;a href="http://www.watchguard.com/archive/files/images/nmap_Fig-1.htm"&gt;Figure 1&lt;/a&gt; (showing your own IP addresses, of course):&lt;br /&gt;&lt;br /&gt;Much of the ROUTE command's output lists information about your network card that we don't care about right now. In our sample output, we've displayed the line of interest in orange text. The first IP address in our output shows our network IP address: 192.168.111.0 with the subnet mask 255.255.255.0 (or 192.168.111.0/24). Similarly, your network IP address should be the first IP address you see in your output.&lt;br /&gt;&lt;br /&gt;Presto! You now have the address you need in order to scan your entire network. So let's get back to Nmap.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How nmap counts your networked devices&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We're helping you get acquainted with Nmap, but you hardly need us if you're willing to experiment a little and read a lot. To access Nmap's help file, at the command prompt just type nmap and press Enter. That's one convenient way to learn about Nmap's options.&lt;br /&gt;&lt;br /&gt;Though nmap is a port scanner, you can use it to do many things. For starters, we'll use the &lt;a href="https://www.watchguard.com/archive/showhtml.asp?pack=1767"&gt;ping command &lt;/a&gt;to automate the task of counting how many computers are currently active on your network. In the command prompt, type&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;nmap -sP 192.168.111.0/24&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;(Of course, replace our sample network's IP address with your network IP address.) You should see a result similar to this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;C:\Program Files\Nmap&gt;nmap -sP 192.168.111.0/24 &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Starting Nmap 4.20 (http://www.insecure.org/nmap ) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;at 2007-05-08 12:18 Pacific Standard Time&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Host 192.168.111.1 appears to be up. &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAC Address: 00:01:02:55:73:C3 (3com) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Host 192.168.111.3 appears to be up.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAC Address: 00:10:5A:27:5C:44 (3com)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Host 192.168.111.254 appears to be up.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAC Address: 00:90:7F:2E:1D:FB (WatchGuard Technologies)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Host frodolinux.hogwarts.lsstest.dyndns.org&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;    (192.168.111.16)appears to be up.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAC Address: 00:04:76:22:C6:65 (3 Com) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Host 192.168.111.34 appears to be up.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Host 192.168.111.126 appears to be up.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;MAC Address: 00:10:4B:0E:E6:E6 (3com)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Nmap finished: 256 IP addresses (6 hosts up) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;scanned in 5.797 seconds &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When you ran that command, Nmap pinged every IP address in the range of the network IP address you supplied. Nmap lists information for the IPs that responded to this request. So the list of IP addresses in our sample result show networked devices that currently respond to ping requests. In this example, Nmap found the following six IPs active on our test network:&lt;br /&gt;&lt;br /&gt;192.168.111.1&lt;br /&gt;192.168.111.3&lt;br /&gt;192.168.111.254&lt;br /&gt;192.168.111.16&lt;br /&gt;192.168.111.34&lt;br /&gt;192.168.111.126&lt;br /&gt;&lt;br /&gt;As you might guess, this is not the most accurate count possible. If you divide some segments of your network using an internal firewall, the firewall might hide any devices behind it. And devices on your network that are powered off when you scan won't respond. But the results are still useful. Repeat the command over time to learn what "normal" is on your network. If a daily scan typically returns 18 to 22 authorized devices, and one day it finds 35, you know it's time to investigate. (Maybe one of the engineers added a rogue wireless access point and now the neighboring businesses are piggybacking onto your WiFi Internet access.)&lt;br /&gt;&lt;br /&gt;If you have many active IPs on your network, your Nmap ping results quickly scroll off the command prompt window. Here are two methods to run the same command, managing the output in different ways. You can use these methods when running any command line application:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To pause output before it scrolls off screen, add  more&lt;br /&gt;Example: &lt;strong&gt;Nmap -sP 192.168.111.0/24  more&lt;/strong&gt;&lt;br /&gt;(Press your spacebar or the Enter key to continue output)&lt;br /&gt;&lt;br /&gt;To capture output to a text file, specify a file name&lt;br /&gt;Example: &lt;strong&gt;Nmap -sP 192.168.111.0/24 &gt; filename.txt&lt;/strong&gt;&lt;br /&gt;(Change "filename" to any name you like)&lt;br /&gt;&lt;br /&gt;Using Nmap to automate your pings, rather than manually pinging hundreds of addresses yourself, is cool. You now know how many devices respond on your network. But that's not even Nmap's primary purpose! You want to use it to port scan your network. So let's do it -- in Part 3, tomorrow. ##&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Part 3&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Recap: &lt;a href="http://www.watchguard.com/archive/showhtml.asp?pack=53169"&gt;Part 1&lt;/a&gt; introduced port scanners in general, and Nmap in particular. You learned where to get Nmap for free, and you installed it. In &lt;a href="https://www.watchguard.com/archive/showhtml.asp?pack=53357"&gt;Part 2&lt;/a&gt;, you learned your network IP address and used Nmap to count the active devices on your network. Now, in the series' conclusion, you're ready to port scan your network and interpret the results.&lt;br /&gt;&lt;br /&gt;Nmap has many powerful options. However, you probably don't have time to learn all of Nmap's features right now. So we'll jut show you a single big ol' Nmap command, with some options switched on, that should provide almost all you want to know about your local network. Think of this command as "Nmap's greatest hits."&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here it is:&lt;br /&gt;&lt;strong&gt;Nmap -P0 -sS -sV -O 192.168.111.0/24 &gt; output.txt&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;As usual, when you try this command, replace our sample network's IP address with your own network IP. You can also change "output.txt" to any filename you like. You're naming the file where Nmap will record the output from this scan.&lt;br /&gt;&lt;br /&gt;What does each &lt;a href="http://www.watchguard.com/glossary/p.asp#parameter"&gt;parameter&lt;/a&gt; in the command do? Briefly:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;-P0&lt;/strong&gt;. This switch tells Nmap not to ping a host before scanning it. As we alluded to when we described ping in &lt;a href="https://www.watchguard.com/archive/showhtml.asp?pack=53357"&gt;Part 2&lt;/a&gt;, in some exceptional cases a computer that is active won't respond to ping (for example, when guarded by a firewall). Smart little Nmap can still find these stealth computers without relying on ping.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;-sS&lt;/strong&gt;. This switch tells Nmap to perform a SYN-based port scan. SYN is short for "synchronize," the first packet sent when one computer tries to connect to another using &lt;a href="http://www.watchguard.com/glossary/t.asp#tcp"&gt;TCP&lt;/a&gt;. A SYN-based port scan is the most common method, among many possible methods.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;-sV&lt;/strong&gt;. This switch tells Nmap to attempt to find the service and version information of the ports it finds open. For instance, if Nmap learns port 80 is open, it tries to discern which web server runs on that port, as well as what version. Think of these as very educated guesses. Nmap is not always right.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;-O&lt;/strong&gt;. This switch tells Nmap to guess what operating system is running on any computer it scans. This, too, is a very informed estimate, not necessarily rock-solid truth.&lt;br /&gt;&lt;br /&gt;We assume that as your company's network administrator, you have senior management's permission to perform analytical operations on your network. If not, this type of Nmap scan can be interpreted as a hostile or provocative action, so go no farther without authorization. But if you are authorized, we encourage you to try this command now.&lt;br /&gt;&lt;br /&gt;Type the command above in your command prompt (carefully...remember, syntax matters!) and press &lt;strong&gt;Enter&lt;/strong&gt;. Depending on the size of your network, and speed of your computer, this command could complete in a minute, an hour, or longer.&lt;br /&gt;&lt;br /&gt;When the command completes, you see a new command prompt. But you won't see any obvious results. That's because you redirected the results to a text file called output.txt (or whatever you renamed it). To see Nmap's results, open output.txt in a text editor. If you followed the default install in Part 1, you'll find output.txt in c:\program files\nmap.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Interpreting the Results of Your Scan&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;You just scanned your whole network, so your results could be lengthy, depending on how many active hosts are on your network. Rather than describing the entire result at once, let's take it a chunk at a time.&lt;br /&gt;&lt;br /&gt;If you click this link for &lt;a href="http://www.watchguard.com/archive/files/images/nmap_Fig-2.htm"&gt;Figure 2&lt;/a&gt;, you'll see a sample representing results from the Nmap scan you just performed. This excerpt contains Nmap's results for one host on our sample network. Once you understand how to read this one excerpt, you'll be able to read the rest of Nmap's results. So click the link and follow along with our commentary.&lt;br /&gt;&lt;br /&gt;The first line of this excerpt tells you that the following result correlates to the IP address, 192.168.39.1.&lt;br /&gt;&lt;br /&gt;The second line of this excerpt says that Nmap scanned 1,659 of that host's ports during the scan. Yes, you're right: 1,659 is fewer than a host's potential 65,535 ports. To save time, by default Nmap scans only the common, &lt;a href="http://webopedia.internet.com/quick_ref/portnumbers.asp"&gt;well-known&lt;/a&gt; ports. You can force Nmap to scan all 65,535 ports if you like. However, scans that large take an extremely long time. And really, scanning the well-known ports usually tells you all you need to know about that host.&lt;br /&gt;&lt;br /&gt;The third line of this excerpt lists four column headings: PORT, STATE, SERVICE, and VERSION. Here's what each heading means:&lt;br /&gt;&lt;br /&gt;The PORT column represents the ports (and protocols) Nmap found on the sample host, 192.168.39.1.&lt;br /&gt;&lt;br /&gt;The STATE column tells you whether each port is open or in some other intermediary state of open (stealth). You will never see closed ports in Nmap's results. Nmap doesn't display the port if it's closed.&lt;br /&gt;&lt;br /&gt;The SERVICE column tells you the well-known network service that usually resides on that port. It displays the service either by formal protocol name, or listed in a sort of technical short hand. You will recognize some of these services, such as HTTP, SMTP, and FTP, from your network experience. With over a thousand possible services, you won't recognize them all. But you have a few options to help you learn what a service is. First, in Nmap's c:\program files\nmap directory, you can open a file named nmap-services in any text editor to read all the services Nmap recognizes. This list contains a longer description of most of the services that appear in the service column. If you still don't recognize a service by either its short-hand or longer description, look both up using Google. You typically find a hundred sites that explain what that service does.&lt;br /&gt;&lt;br /&gt;The VERSION column tells you what specific program the host you scanned uses to control the service in question. It also attempts to tell you that program's version.&lt;br /&gt;&lt;br /&gt;Now that you know what each heading is, you should be able to interpret much of what follows. A new line appears under these four headings for each open port on a scanned host.&lt;br /&gt;&lt;br /&gt;Let's practice interpreting a few random lines from our sample excerpt. First:&lt;br /&gt;&lt;strong&gt;25/tcp open smtp Microsoft ESMTP 5.0.2195.6713&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This line tells you that the host Nmap scanned has port 25 open. Port 25 is the SMTP, or email, service port. Nmap thinks the host is probably running Microsoft's ESMTP Mail Server, version 5.0.2195.6713.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Second example: &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;80/tcp open http Microsoft IIS webserver 5.0&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;In this line, we learn that port 80, the HTTP or web service port, is open on the scanned host. According to Nmap's best guess, this port is probably running Microsoft's IIS version 5.0 Web server. This is not really rocket science, huh?&lt;br /&gt;&lt;br /&gt;After all the lines that follow the PORT, STATE, SERVICE, VERSION columnar format, you eventually come to lines that no longer follow this format. You'll see a line that tells you the &lt;a href="http://www.watchguard.com/glossary/m.asp#mac_address"&gt;MAC address&lt;/a&gt; of the host that was scanned. In our example, the host uses a 3COM network card.&lt;br /&gt;&lt;br /&gt;The next line tells you the type of device you most likely scanned. So far, we've referred to the IP we scanned as a "host" because we don't know if it's a computer, a printer, a specialized network device, or what -- until now, that is. The "Device Type" line tells you what device Nmap thinks it's found. Our example says "general purpose," which typically indicates a computer.&lt;br /&gt;&lt;br /&gt;Finally, the remaining lines tell you what operating system Nmap thinks is running on this computer. Nmap thinks this computer runs either Windows ME, 2000, or XP.&lt;br /&gt;&lt;br /&gt;And that is enough to get you started. You now can interpret Nmap's port scan results. Sure, if you have a large network, you may have hundreds of excerpts like this. But you interpret them all the same way. Lather, rinse, repeat.&lt;br /&gt;&lt;br /&gt;Are you now a port scanning expert? Well, hardly. Our hope is that this small amount of interaction with Nmap has torn away any intimidating mystique that command line tools might have held for you. We hope it's whet your appetite to learn more.&lt;br /&gt;&lt;br /&gt;Scan on a regular, recurring basis until you have a feel for what's normal on your network. Read up on results that puzzle you. Then you've dramatically increased your likelihood of spotting interlopers -- and it didn't take a penny out of your department's budget. ##&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-7797196544166927498?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/7797196544166927498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=7797196544166927498' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7797196544166927498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7797196544166927498'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/using-nmap-tool.html' title='Using NMAP TOOL'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-1226353842199209945</id><published>2007-07-22T23:02:00.000-07:00</published><updated>2007-07-22T23:10:25.275-07:00</updated><title type='text'>How to use a tape drive in Linux?</title><content type='html'>Sometimes remembering the way to access your tape drive in linux aint that easy, follow this basic guide which has almost all the neccesary commands you might execute on your tape drive.&lt;br /&gt;&lt;br /&gt;  As I said, this is a very basic guide with pretty much most if not all commands you will probably execute in your tape drive on a linux environment. Enjoy&lt;br /&gt;&lt;br /&gt;Check if tapedrive is online:&lt;br /&gt;&lt;strong&gt;mt -f /dev/st0 status&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Erase tapedrive:&lt;br /&gt;&lt;strong&gt;mt -f /dev/st0 erase&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Copy some content to a tapedrive:&lt;br /&gt;&lt;strong&gt;tar cvf /dev/st0 /content_path/content.archive&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;List files on a tape:&lt;br /&gt;&lt;strong&gt;tar tvf /dev/st0&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Restore from the tape:&lt;br /&gt;&lt;strong&gt;tar xvf /dev/st0&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Restore an specific archive&lt;br /&gt;&lt;strong&gt;tar xvf /dev/st0 /folder/archive.dmp&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;As I always say, hope this was usefull.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-1226353842199209945?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/1226353842199209945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=1226353842199209945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/1226353842199209945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/1226353842199209945'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/how-to-use-tape-drive-in-linux.html' title='How to use a tape drive in Linux?'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-7989923868198787672</id><published>2007-07-22T22:46:00.000-07:00</published><updated>2007-07-22T22:55:43.378-07:00</updated><title type='text'>Adding a null route to a host on linux</title><content type='html'>Personally ive found this to be of great help while dealing with ddos attackers or just someone that i need to kick out completely from a server i manage.&lt;br /&gt;&lt;br /&gt;  As a webhosting company owner / administrator this is a saver and sometimes saves you time of going directly into the firewall and block someone.&lt;br /&gt;&lt;br /&gt;This is done by adding the following line to the /etc/sysconfig/static-routes file:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;any host 111.111.111.111 reject (being 111.111.111.111 the ip address to block)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;When you perform a "&lt;strong&gt;route -n&lt;/strong&gt;" you will see this IP with "-" as it's gateway. This will cause your server to drop all response traffic to this IP.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Destination Gateway Genmask Flags Metric Ref Use Iface&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;111.111.111.111 - 255.255.255.255 !H 0 - 0 -&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;If you wish to un-blacklist this IP in the future simply remove the aforementioned line from the static-routes file and restart the "network" service os the server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-7989923868198787672?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/7989923868198787672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=7989923868198787672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7989923868198787672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7989923868198787672'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/adding-null-route-to-host-on-linux.html' title='Adding a null route to a host on linux'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-2603711011607405377</id><published>2007-07-22T22:31:00.000-07:00</published><updated>2007-07-22T22:41:44.667-07:00</updated><title type='text'>Make a backup Using Tar in linux</title><content type='html'>This is just a small example of how you can use the TAR application with linux to generate a powerfull backup script triggered by a cron.&lt;br /&gt;&lt;br /&gt;You will need to create an archive , either using vi or touch.&lt;br /&gt;&lt;br /&gt;For example in this case lets say our script is called backup&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;vi backup&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;This will create the archive and open the vi editor, to add content to the archive press the I key to insert and then check out at my example here:&lt;br /&gt;&lt;br /&gt;#--------------------------------------&lt;br /&gt;#Beggining of script&lt;br /&gt;#--------------------------------------&lt;br /&gt;&lt;br /&gt;# Lets say you want to remove an old backup on autobackups folderrm /autobackups/mybackup*.*&lt;br /&gt;&lt;br /&gt;# Now lets say you want to make the script sleep for 3 secondssleep 3&lt;br /&gt;&lt;br /&gt;#Now you want to backup /home entirely into /autobackups using tar&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;tar -cvf /autobackups/home$(date +%y%m%d).tar /home&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;#---END---&lt;br /&gt;&lt;br /&gt;Please notice that you are creating a tar archive with the whole content of /home and adding the date of the backup to the name of the archive. To execute this script, you need to save it , on VI press ESCAPE , then activate the CAPS LOCK and press the Z key 2 times. (zz)&lt;br /&gt;&lt;br /&gt;You will need to give the archive execute permissions, use the following command: chmod a+x backup , basically to run the script just type ./backup considering you are on the same path of the archive. Easy does it :)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-2603711011607405377?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/2603711011607405377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=2603711011607405377' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2603711011607405377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2603711011607405377'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/make-backup-using-tar-in-linux.html' title='Make a backup Using Tar in linux'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-168536207790848835</id><published>2007-07-17T13:13:00.000-07:00</published><updated>2007-07-17T13:16:31.197-07:00</updated><title type='text'>Changing the hostname to a Unix box</title><content type='html'>The following simple instructions can help you change your linux box / server hostname with ease , the first option is permanent , option number two will change the host name but changes wont be reflected after a reboot. Check it out&lt;br /&gt;  As described above, there are 2 ways to change the hostname of a linux box manually or by terminal ( real man do it by terminal )&lt;br /&gt;&lt;br /&gt; This first option will save the changes even after a reboot:&lt;br /&gt;&lt;br /&gt;Edit:&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;vi /etc/sysconfig/network&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HOSTNAME=.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Second option:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;vi /proc/sys/kernel/hostname&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;but that won't be saved when you reboot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-168536207790848835?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/168536207790848835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=168536207790848835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/168536207790848835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/168536207790848835'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/changing-hostname-to-unix-box.html' title='Changing the hostname to a Unix box'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-5346455863159481588</id><published>2007-07-17T13:04:00.001-07:00</published><updated>2007-07-17T13:10:20.932-07:00</updated><title type='text'>Using *nix bash to connect to an FTP</title><content type='html'>Have you been in the need of an automatic script that connects to a remote ftp server to copy some backups or something similar? There is no need to be a bash expert, the following simple example can give you the basics to have a fully functional ftp script on bash.&lt;br /&gt;Yes, for any *nix user bash is definitely an usefull part of the operating system, the problem is not everybody has the proper programming basics to interact with bash and really exploit the great power you can find in unix based operating systems like linux or solaris.&lt;br /&gt;&lt;br /&gt;The example below, is a simple script that will connect to server with ip address 192.168.2.191 and basically copy a dump file called myexample.dump into the remote location mentioned before as exampleremote.dump&lt;br /&gt;&lt;br /&gt;Please notice you need to create a blank archive, lets call it ftpbash.ex&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;touch ftpbash.ex&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Next use VI editor to edit the file:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;vi ftpbash.ex&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Now copy the following code:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;#!/bin/sh&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;UPASSWD="myuser"&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;USER="mypass"&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ftp -i -v -n 192.168.2.191 &lt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;user $USER $UPASSWD&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;binary&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;send /myexample.dump /exampleremote.dump&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;bye&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Next basically save the file ( CapsLock , then press Z twice)&lt;br /&gt;&lt;br /&gt;Now to execute the script you need to give execution permissions to it, so type:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;chmod a+x ftpbash.ex&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;To execute it just type &lt;strong&gt;./ftpbash.ex&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Please notice on the bash script we are sending both the user and password of the ftp server in order to complete the connection.You could use any valid ftp command on the script like in the example, the command send is a native ftp command, with this basic script im sure you could start a nice learning curve of the usefull features of bash, its a must know for any serious *nix programmer or administrator.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-5346455863159481588?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/5346455863159481588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=5346455863159481588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/5346455863159481588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/5346455863159481588'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/using-nix-bash-to-connect-to-ftp.html' title='Using *nix bash to connect to an FTP'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-2489854718710248618</id><published>2007-07-12T11:45:00.000-07:00</published><updated>2007-07-12T12:28:55.386-07:00</updated><title type='text'>How to Use VI editor ?</title><content type='html'>The VI editor is the most common editor on any unix environment, wether your favorite flavor of *nix is solaris or linux or freebsd vi is a must know to develop properly on the unix environments.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Modes :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Vi has two modes insertion mode and command mode. The editor begins in command mode, where the cursor movement and text deletion and pasting occur. Insertion mode begins upon entering an insertion or change command. [ESC] returns the editor to command mode (where you can quit, for example by typing :q!). Most commands execute as soon as you type them except for "colon" commands which execute when you press the ruturn key.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Quitting :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;:x Exit, saving changes&lt;br /&gt;:q Exit as long as there have been no changes&lt;br /&gt;ZZ Exit and save changes if any have been made&lt;br /&gt;:q! Exit and ignore any changes&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Inserting Text :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;i Insert before cursor&lt;br /&gt;I Insert before line&lt;br /&gt;a Append after cursor&lt;br /&gt;A Append after line&lt;br /&gt;o Open a new line after current line&lt;br /&gt;O Open a new line before current line&lt;br /&gt;r Replace one character&lt;br /&gt;R Replace many characters&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Motion :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;h Move left&lt;br /&gt;j Move down&lt;br /&gt;k Move up&lt;br /&gt;l Move right&lt;br /&gt;w Move to next word&lt;br /&gt;W Move to next blank delimited word&lt;br /&gt;b Move to the beginning of the word&lt;br /&gt;B Move to the beginning of blank delimted word&lt;br /&gt;e Move to the end of the word&lt;br /&gt;E Move to the end of Blank delimited word&lt;br /&gt;( Move a sentance back&lt;br /&gt;) Move a sentance forward&lt;br /&gt;{ Move a paragraph back&lt;br /&gt;} Move a paragraph forward&lt;br /&gt;0 Move to the begining of the line&lt;br /&gt;$ Move to the end of the line&lt;br /&gt;1G Move to the first line of the file&lt;br /&gt;G Move to the last line of the file&lt;br /&gt;nG Move to nth line of the file&lt;br /&gt;:n Move to nth line of the file&lt;br /&gt;fc Move forward to c&lt;br /&gt;Fc Move back to c&lt;br /&gt;H Move to top of screen&lt;br /&gt;M Move to middle of screen&lt;br /&gt;L Move to botton of screen&lt;br /&gt;% Move to associated ( ), { }, [ ]&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Deleting Text :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Almost all deletion commands are performed by typing d followed by a motion. For example, dw deletes a word. A few other deletes are:&lt;br /&gt;&lt;br /&gt;x Delete character to the right of cursor&lt;br /&gt;X Delete character to the left of cursor&lt;br /&gt;D Delete to the end of the linedd Delete current line&lt;br /&gt;:d Delete current line&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Yanking Text :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Like deletion, almost all yank commands are performed by typing y followed by a motion. For example, y$ yanks to the end of the line. Two other yank commands are&lt;br /&gt;&lt;br /&gt;:yy Yank the current line&lt;br /&gt;:y Yank the current line&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Changing text :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;The change command is a deletion command that leaves the editor in insert mode. It is performed by typing c followed by a motion. For wxample cw changes a word. A few other change commands are:&lt;br /&gt;&lt;br /&gt;C Change to the end of the line&lt;br /&gt;cc Change the whole line&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Putting text :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;p Put after the position or after the line&lt;br /&gt;P Put before the poition or before the line&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Buffers&lt;/strong&gt; :-&lt;br /&gt;&lt;br /&gt;Named buffers may be specified before any deletion, change, yank or put command. The general prefix has the form "c where c is any lowercase character. for example, "adw deletes a word into buffer a. It may thereafter be put back into text with an appropriate "ap.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Markers :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Named markers may be set on any line in a file. Any lower case letter may be a marker name. Markers may also be used as limits for ranges.&lt;br /&gt;mc Set marker c on this line&lt;br /&gt;&lt;br /&gt;`c Go to beginning of marker c line.&lt;br /&gt;'c Go to first non-blank character of marker c line.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Search for strings :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;/string Search forward for string&lt;br /&gt;?string Search back for string&lt;br /&gt;n Search for next instance of string&lt;br /&gt;N Search for previous instance of string&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Replace :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;The search and replace function is accomplished with the :s command. It is commonly used in combination with ranges or the :g command (below).&lt;br /&gt;&lt;br /&gt;:s/pattern/string/flags Replace pattern with string according to flags.&lt;br /&gt;g Flag - Replace all occurences of pattern&lt;br /&gt;c Flag - Confirm replaces.&lt;br /&gt;&amp; Repeat last :s command&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Regular Expressions :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;. (dot) Any single character except newline&lt;br /&gt;* zero or more occurances of any character&lt;br /&gt;[...] Any single character specified in the set&lt;br /&gt;[^...] Any single character not specified in the set&lt;br /&gt;^ Anchor - beginning of the line$ Anchor - end of line&lt;br /&gt;\&lt; Anchor - begining of word&lt;br /&gt;\&gt; Anchor - end of word&lt;br /&gt;\(...\) Grouping - usually used to group conditions&lt;br /&gt;\n Contents of nth grouping&lt;br /&gt;&lt;br /&gt;[...] - Set Examples [A-Z] The SET from Capital A to Capital Z&lt;br /&gt;[a-z] The SET from lowercase a to lowercase z&lt;br /&gt;[0-9] The SET from 0 to 9 (All numerals)&lt;br /&gt;[./=+] The SET containing . (dot), / (slash), =, and +&lt;br /&gt;[-A-F] The SET from Capital A to Capital F and the dash (dashes must be specified first)&lt;br /&gt;[0-9 A-Z] The SET containing all capital letters and digits and a space&lt;br /&gt;[A-Z][a-zA-Z] In the first position, the SET from Capital A to Capital ZIn the second character position, the SET containing all letters&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Regular Expression Examples /Hello/ Matches if the line contains the value Hello&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;/^TEST$/ Matches if the line contains TEST by itself&lt;br /&gt;/^[a-zA-Z]/ Matches if the line starts with any letter&lt;br /&gt;/^[a-z].*/ Matches if the first character of the line is a-z and there is at least one more of any character following it&lt;br /&gt;/2134$/ Matches if line ends with 2134&lt;br /&gt;/\(2135\)/ Matches is the line contains 21 or 35&lt;br /&gt;Note the use of ( ) with the pipe symbol to specify the 'or' condition&lt;br /&gt;/[0-9]*/ Matches if there are zero or more numbers in the line&lt;br /&gt;/^[^#]/ Matches if the first character is not a # in the line&lt;br /&gt;&lt;br /&gt;Notes:&lt;br /&gt;1. Regular expressions are case sensitive&lt;br /&gt;2. Regular expressions are to be used where pattern is specified&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Counts :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Nearly every command may be preceded by a number that specifies how many times it is to be performed. For example, 5dw will delete 5 words and 3fe will move the cursor forward to the 3rd occurence of the letter e. Even insertions may be repeated conveniently with thismethod, say to insert the same line 100 times.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ranges :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Ranges may precede most "colon" commands and cause them to be executed on a line or lines. For example :3,7d would delete lines 3-7. Ranges are commonly combined with the :s command to perform a replacement on several lines, as with :.,$s/pattern/string/g to make a replacement from the current line to the end of the file.&lt;br /&gt;&lt;br /&gt;:n,m Range - Lines n-m&lt;br /&gt;:. Range - Current line&lt;br /&gt;:$ Range - Last line&lt;br /&gt;:'c Range - Marker c&lt;br /&gt;:% Range - All lines in file&lt;br /&gt;:g/pattern/ Range - All lines that contain pattern&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Files :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;:w file Write to file&lt;br /&gt;:r file Read file in after line&lt;br /&gt;:n Go to next file&lt;br /&gt;:p Go to previos file&lt;br /&gt;:e file Edit file&lt;br /&gt;!!program Replace line with output from program&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Other :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;~ Toggle upp and lower case&lt;br /&gt;J Join lines&lt;br /&gt;. Repeat last text-changing command&lt;br /&gt;u Undo last change&lt;br /&gt;U Undo all changes to line&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-2489854718710248618?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/2489854718710248618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=2489854718710248618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2489854718710248618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2489854718710248618'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/how-to-use-vi-editor.html' title='How to Use VI editor ?'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-83351246630959452</id><published>2007-07-10T00:51:00.000-07:00</published><updated>2007-07-10T01:14:30.476-07:00</updated><title type='text'>Linux Disk utilities</title><content type='html'>&lt;strong&gt;Here is a list of Linux Disk utilities&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;fdisk /dev/hda&lt;/strong&gt;&lt;br /&gt;(= "fixed disk". As root.) Linux hard drive partitioning utility (DOS has a utility with the same name). In the example above, I specified that I would like to partition the first harddrive on the first IDE interface, hence "hda". If I were you, i would backup any important data before using fdisk on any partition. I do not not know anybody who likes fdisk (either Linux or DOS edition)--I prefer easier to use cfdisk, see next command.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;cfdisk /dev/hda&lt;/strong&gt;&lt;br /&gt;(as root) Hard drive partitioning utility, menu-based. Easier to use then the plain-vanilla fdisk (see the previous command). Physical drives can contain primary partitions (max 4 per disk), and logical partitions (no restriction on number). A primary partition can be bootable. Logical partitions must be contained within "extended partitions"; extended partitions are not usable by themselves, they are just a container for logical partitions. When partitioning a disk, I typically: (1) create a primary partition (2) make the primary partition bootable (3) create an extended partition, (4) create logical partition(s) within the extended partition.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;sfdisk -l -x more&lt;/strong&gt;&lt;br /&gt;(as root) List the partition tables (including extended partitions) for all drives on my system.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;parted /dev/hda&lt;/strong&gt;&lt;br /&gt;A partition manipulation utility for Linux (ext2), and DOS (FAT and FAT32) hard drive partition. It is for creation, destroying, moving, copying, shrinking, and extending partitions. You should really like to backup your data and carefully read info parted before using it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;fdformat /dev/fd0H1440 &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;mkfs -c -t ext2 /dev/fd0&lt;/strong&gt;&lt;br /&gt;(=floppy disk format, two commands, as root) Perform a low-level formatting of a floppy in the first floppy drive (/dev/fd0), high density (1440 kB). Then make a Linux filesystem (-t ext2), checking/marking bad blocks (-c ). Making the filesystem is an equivalent to the high-level formatting. I can also format floppies to different (also non-standard) densities; try ls /dev/fd0 .I am also able to format to the default density (normally 1440k) using fdformat /dev/fd0.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;badblocks /dev/fd01440 1440&lt;/strong&gt;&lt;br /&gt;(as root) Check a high-density floppy for bad blocks and display the results on the screen. The parameter "1440" specifies that 1440 blocks are to be checked. This command does not modify the floppy. badblocks can be also used to check the surface of a hard drive but I have to &lt;strong&gt;unmount&lt;/strong&gt; the filesystem first to do a full read-write check:&lt;br /&gt;&lt;strong&gt;mount&lt;/strong&gt; [to find out which device contains the disk partition I wish to check for bad blocks] &lt;strong&gt;umount /dev/hda8&lt;/strong&gt; [unoumnt the selected partition]&lt;br /&gt;&lt;strong&gt;badblocks -n /dev/hda8&lt;/strong&gt; [check the selected partition in a non-destructive read-write mode, so that my data is not erased!]&lt;br /&gt;&lt;strong&gt;mount /dev/hda8&lt;/strong&gt; [mount the partition back since no info on bad blocks was printed]&lt;br /&gt;If bad blocks are found, they can be marked on the hard drive so that will not be used using: &lt;strong&gt;e2fsck -c /dev/hda8&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;fsck -t ext2 /dev/hda2&lt;/strong&gt;&lt;br /&gt;(=file system check, as root) Check and repair a filesystem, e.g., after an "unclean" shutdown due to a power failure. The above example performs the check on the partition hda2, filesystem type ext2. You definitely want to unmount the partitions or boot Linux in the "single mode" to perform this (type "linux single" at the LILO prompt or use init 1 as root to enter the single user mode). If errors are found during the filesystem checkup, I accept the defaults for repair.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;tune2fs -j /dev/hda2&lt;/strong&gt;&lt;br /&gt;(as root, only for kernel that support ext3--RH7.2) Adjust the tuneable parameter of an ext2 filesystem. The example above shows how to add a journal to a disk partition (hda2 in this example), effectively converting the file system to ext3 (journaling) filesystem. To complete the transition, you must also edit the file /etc/fstab and change the filesystem type from ext2 to ext3, else you may run into problems--ext2 will not mount an uncleanly shut down journaled filesystem! To check what is the type of the filesystem use mount (with no arguments) or cat /etc/mtab. Other options of tune2fs let you me add a volume label, adjust the number of mounts after which the filesystem check is performed (maximal mount count), or turn on time-based filesystem checks instead (less often used).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;dd if=/dev/fd0H1440 of=floppy_image &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;dd if=floppy_image of=/dev/fd0H1440&lt;/strong&gt;&lt;br /&gt;(two commands, dd="data duplicator") Create an image of a floppy to the file called "floppy_image" in the current directory. Then copy floppy_image (file) to another floppy disk. Works like DOS "DISKCOPY".&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;mkbootdisk --device /dev/fd0 2.4.2-3&lt;/strong&gt;&lt;br /&gt;Make an emergency boot floppy. You are typically asked if you would like to make a boot disk during the system installation. The above command shows how to make it after install, on the first floppy drive (/dev/fd0). Your kernel name (needed in the command, here 2.4.2-3) can be determined either by running uname -a or ls /lib/modules .&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;dd if=diskboot.img of=/dev/sda&lt;/strong&gt;&lt;br /&gt;booting from a USB .Also check is sda definitely your USB drive? I would imagine that your own system drive might be /dev/sda as all SCSI, IDE and SATA drives use the /dev/sd? naming convention now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-83351246630959452?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/83351246630959452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=83351246630959452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/83351246630959452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/83351246630959452'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/linux-disk-utilities.html' title='Linux Disk utilities'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-7475680978098417851</id><published>2007-07-08T17:32:00.000-07:00</published><updated>2007-07-08T17:34:21.921-07:00</updated><title type='text'>How to Change Password?</title><content type='html'>The command to change your password on unix is &lt;strong&gt;passwd&lt;/strong&gt;. The system will prompt you to enter your current password, then a new one. Your chosen password will be checked against a password cracking program, and if it is too easy to crack you will have to try again. Use a mixture of upper and lower case letters, numbers and punctuation characters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-7475680978098417851?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/7475680978098417851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=7475680978098417851' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7475680978098417851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/7475680978098417851'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/how-to-change-password.html' title='How to Change Password?'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-904296224363721818</id><published>2007-07-08T17:17:00.000-07:00</published><updated>2007-07-08T17:24:49.951-07:00</updated><title type='text'>How to setup an SSH tunnel?</title><content type='html'>SSH is a powerful daemon that can do much more than simply log you into a server. One particularly useful function it provides is tunneling, whereby you can connect a client on your computer to a remote server and run a service you might not otherwise be able to access.&lt;br /&gt;&lt;br /&gt;   Tunneling will only work for applications that run over a TCP-based protocol and that allow you to specify what port the client should connect to. It is quite simple to setup a tunnel; all you have to do is tell SSH which port on your computer (the local port) is to be connected to which port on the remote server (the remote port), and then tell your client to use that local port. By default clients usually go straight to the remote port.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Commandline SSH :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;  The basic form of the command is:ssh -L &lt;local-port&gt;:localhost:&lt;remote-port&gt; &lt;host&gt;where &lt;local-port&gt; is an unused high-number port on your pc, eg. 2300, 14328 or 45000&lt;remote-port&gt; is the well-known port for the service you wish to useand &lt;host&gt; is one of CSE's general access servers, eg. hummel, wagner or weillthen point your local client's port configuration to localhost:&lt;local-port&gt;. There are variations on this basic form which you can experiment with, see the manpage.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;PuTTY :-&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;*In the side menu click on Connection-&gt;SSH-&gt;Tunnels .&lt;br /&gt;*if you will be running X11 programs, select X11 Forwarding. Leave X Display Location as localhost:0&lt;br /&gt;*do &lt;strong&gt;not&lt;/strong&gt; select 'local ports accept connections from other hosts' under Port Forwarding unless you have a particular reason for doing so&lt;br /&gt;*under Add New Forwarded Port fill in the values for Source Port and Destination, select Local.&lt;br /&gt;*click Add and Open&lt;strong&gt; &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;SSHWinclient :-&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;*In the top bar click on Edit-&gt;Settings-&gt;Profile Settings-&gt;Tunneling&lt;br /&gt;*click Add&lt;br /&gt;*enter a Display Name if you desire&lt;br /&gt;*leave Type as TCP&lt;br /&gt;*fill in the values for the Listen Port (local port), Destination host and port&lt;br /&gt;*select Allow Local Connection only and click OK&lt;br /&gt;*select Tunnel X11 if you will be running X11 programs&lt;br /&gt;*select Enable for SSH1 connections, click OK&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-904296224363721818?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/904296224363721818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=904296224363721818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/904296224363721818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/904296224363721818'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/how-to-setup-ssh-tunnel.html' title='How to setup an SSH tunnel?'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-3334320558457784194</id><published>2007-07-06T10:47:00.000-07:00</published><updated>2007-07-06T11:09:56.302-07:00</updated><title type='text'>Load Balancing Using Round Robin</title><content type='html'>Creating a Load Balancing effect with DNS servers is easier than you might think. Maybe if you have ever heard of the term round robin algorythms you have an idea of what im talking about. Find out a detail article of load balancing using DNS servers like BIND.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Configure Round Robin&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt;We take for granted that you already have multiple servers and that you are in need og dividing your load between servers. The most typical load balacing scenarios are applied on web servers, however you can do it with Mail Servers or other type of services as needed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Balancing Mail&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;You can balance your mail simply adding different mail hosts with the same mail priority, like in the case below, you will notice 3 instances of mail servers with a priority of 10. This simply will divide the load between the 3 servers.&lt;br /&gt;&lt;br /&gt;Define multiple MX records with the same priority&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;; zone file fragment      IN  MX  10  mail.example.com.      &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;                                        IN  MX  10  mail1.example.com.      &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;                                        IN  MX  10  mail2.example.com&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;.....&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; mail  IN  A       192.168.0.1 &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; mail1 IN  A       192.168.0.2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; mail2 IN  A       192.168.0.3&lt;/strong&gt;&lt;br /&gt;The name server will deliver the MX records in the order defined by the rrset-order and the receiving SMTP software will select one based on its algorithm. In some cases the SMTP alogithm may work against the definition of the rrset-order statement. Current versions of sendmail (8.13.x), Exim (4.44) and Postfix (2.1 or 2.2) all have definitive references to indicate they randomly select equal preference servers (Postfix allows control of the behaviour with the smtp_randomize_addresses parameter) and consequentially may use an address which the rrset-order has carefully tried to change! qmail, courier-mta and Microsoft (Exchange and IIS SMTP) documentation do not appear to have definitive references to indicate how they handle this case.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2&lt;/strong&gt;. The alternate approach is to define multiple A records with the same name and different IP addresses.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;; zone file fragment        &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;  IN  MX  10  mail.example.com&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;.....&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;mail  IN  A       192.168.0.4&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;         IN  A       192.168.0.5                        &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;         IN  A       192.168.0.6&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;In this case the load-balancing effect is under the control of BIND and the rrset-order record. In order to avoid problems if the receiving mail system does reverse look up as a spam check then the PTR records for 192.168.0.4, 192.168.0.5, 192.168.0.6 above must all define to mail.example.com.&lt;br /&gt;&lt;br /&gt;In all the above cases each mail server must be capable of handling and synchronising the load for all the mail boxes served by the domain, using some appropriate back-end to do this or by defining all but one server to be a relay or forwarder.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Balancing Other Services&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Assuming you want to load share your ftp or web services then you simply define multiple A records with the same name and different IPs as in the example below.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;; zone file fragment&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ftp   IN  A   192.168.0.4&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ftp   IN  A   192.168.0.5&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ftp   IN  A   192.168.0.6&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;www   IN  A   192.168.0.7&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;www   IN  A   192.168.0.8&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;; or use this format which gives exactly the same result&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ftp      IN  A   192.168.0.4            &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;            IN  A   192.168.0.5           &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;            IN  A   192.168.0.6&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;www  IN  A   192.168.0.7            &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;            IN  A   192.168.0.8&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The DNS will deliver all the IP addresses defined, the first IP address in the list will be in a default round robin (controlled by the rrset 'named.conf' directive). The FTP and WEB servers must all be exact replicas of each other in this scenario.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Controlling the order of RRs&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;You can control the order of RR that BIND supplies in response to queries by use of a rrset-order option which works for any set of equal records. The default behaviour is defined to be random-cyclic - a random selection of the initial order thereafter cyclic (round-robin). Experimentation with BIND 9.3.0 showed that the default is cyclic.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rrset-order&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;rrset-order { order_spec ; [ order_spec ; ... ]&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rrset-order&lt;/strong&gt; defines the order in which multiple records of the same type are returned. This works for any record type in which the records are similar. RRSET&lt;strong&gt;-ORDER IS FULLY IMPLEMENTED IN BIND &gt; 9.2.3.&lt;/strong&gt; The default is defined to be a random-cyclic order (the starting address is randomly chosen and thereafter round-robin order). Note: Experimentation showed the default to be pure cyclic.&lt;br /&gt;&lt;br /&gt;The full specification of &lt;strong&gt;rrset-order&lt;/strong&gt; is shown below. An 'order_spec' is defined as:&lt;br /&gt;&lt;br /&gt;class class_name ][ type type_name ][ name "domain_name"] order ordering;&lt;br /&gt;&lt;br /&gt;Where 'class_name' is the record class e.g. IN (default is 'any'), type is the resource record type (if none specified defaults to 'any'), domain_name limits the statement to a specific domain suffix and defaults to root (all domains), order is a key word and ordering may take one of the following values:&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;* fixed - records are returned in the order they are defined in the zone file&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;* random - records are returned in a random order&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;* cyclic - records are returned in a round-robin fashion&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Defines that all equal records for all domains will be returned in random order.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rrset-order {order random;};&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Defines that all equal MX records for all example.com will be returned in random order all others in cyclic order.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rrset-order {type MX order random name "example.com"; order cyclic};&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;This statement may be used in a view or a global options clause.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Effectiveness of DNS Load Balancing&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Assuming the interest in controlling the order is to load balance across multiple servers supporting a single service - the real question is how effective can the DNS system be in providing this balancing?&lt;br /&gt;&lt;br /&gt;The effects of caching will distort the effectiveness of any IP address allocation algorithm unless a 0 TTL is used which has the effect of significantly increasing the load on the DNS (and is not always implemented consistently). In this case the cure may be worse than the disease Good news we have good load balancing on our web servers. Bad news we need 17 more DNS servers!. Intuitively, and without running any experiments to verify, we would suggest that given a normal TTL (12 hours or more) and ANY IP allocation algorithm other than a single static list, loads should be reasonably balanced (measured by request arrivals at destination IPs) given the following assumptions:&lt;br /&gt;&lt;br /&gt;1. traffic is balanced over a number of DNS caches i.e. traffic originates from a number of ISPs or customer locations. Specifically there are no PATHOLOGICAL patterns where 90% (or some large'ish number) of the load originates from a particular cache/service).&lt;br /&gt;&lt;br /&gt;2. the volume of traffic is reasonably high - since PATHOLOGICAL patterns are more likely in small traffic volumes.&lt;br /&gt;&lt;br /&gt;What DNS load balancing cannot do is to account for service loading e.g. certain transactions may generate very high CPU or resource loads. For this type of control only a local load balancer - one which measures response times - will be effective.&lt;br /&gt;&lt;br /&gt;Finally on this topic if you still consider that a DNS solution will do the trick if only you could control the order of IP address generation you can use the BIND 9 SDB API to achieve the result.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-3334320558457784194?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/3334320558457784194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=3334320558457784194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/3334320558457784194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/3334320558457784194'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/load-balancing-using-round-robin.html' title='Load Balancing Using Round Robin'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-442612422276249009</id><published>2007-07-06T06:17:00.000-07:00</published><updated>2007-07-06T06:38:10.307-07:00</updated><title type='text'>Disable directory browsing , APACHE</title><content type='html'>One of the "must do's" on setting a secure apache webserver environment is to disable directory browsing. As a default Apache will be compiled with this option enabled, but its always a good idea to get rid of this setting unless its really necessary. If you have some basic knowledge of vi editor follow this steps&lt;br /&gt;   &lt;br /&gt;  If you are on an RPM installation of Apache (which i dont really recommend) you will find the apache configuration&lt;br /&gt;&lt;br /&gt;file probably here:&lt;br /&gt;&lt;strong&gt;/etc/httpd/conf/httpd.conf&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;If you are using apache from the source tar balls ( like real men ) probably you will find the configuration file here:&lt;br /&gt;&lt;strong&gt;/usr/local/apache/conf/httpd.conf&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Using an editor like vi , edit the httpd.conf file and scroll until you find a line like this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Options All Indexes FollowSymLinks MultiViews&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To disable directory browsing carefully remove the line that says: Indexes and leave the line like this:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Options All FollowSymLinks MultiViews&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Restart your apache webserver and thats it&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-442612422276249009?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/442612422276249009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=442612422276249009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/442612422276249009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/442612422276249009'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/disable-directory-browsing-apache.html' title='Disable directory browsing , APACHE'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-2701629820676669559</id><published>2007-07-06T05:45:00.000-07:00</published><updated>2007-07-06T05:49:46.690-07:00</updated><title type='text'>How to Restrict users in thier home directory?</title><content type='html'>&lt;strong&gt;Problem:&lt;/strong&gt;&lt;br /&gt;    Traditionally, the best way to "lock down" users to their home directory is to use a "change rooted environment". However, this is expensive (resource wise) and sometimes not a very "nice" way to secure a server on a user per user basis.&lt;br /&gt;For V-hosters, most of your concern lies in the simple feat of keeping customers from poking around your system, and other user's home dirs--without limiting their ability to execute binaries in their normal system path.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;To set up your system to use it... just do this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;chmod 700 /home -R&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Not sure about that though. you might want a second oppinion.'Edit: That will work for home directory, as for system files I dont think that will work since many things have to be readable to work&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-2701629820676669559?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/2701629820676669559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=2701629820676669559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2701629820676669559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/2701629820676669559'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/how-to-restrict-users-in-thier-home.html' title='How to Restrict users in thier home directory?'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7521144173919293619.post-4693992455291728440</id><published>2007-07-06T04:08:00.000-07:00</published><updated>2007-07-06T05:35:11.891-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Usefull commands'/><title type='text'>Some Unix Commands.</title><content type='html'>&lt;strong&gt;Directory:- pwd, cd, mkdir, rmdir, rm -rf&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Display the current directory path you are in.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;pwd&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Change directories&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;cd directory&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;cd path\to\directory&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Create a new directory&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;mkdir directory_name&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Delete an empty directory&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rmdir directory_name&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Delete a directory and all sub directories/files.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rm -rf directory_name&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Files :- ls, ls -l,ls -la, cp, mv, rm, rm -i&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;List files in a directory&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ls&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ls -l&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;ls -al&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;copy a file to another filename.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;cp filename1 filename2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;move or rename a file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;mv filename1 filename2&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;mv filename1 directory\filename2&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Delete a file (with rm you will not usually get a prompt to confirm)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;rm filename&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;rm -i filename&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;--------------&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Shortcuts :- cd, alias&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Go to a directory within your home directory.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;cd ~/directory&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Change to your home directory&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;cd (by itself)&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;Go back 1 directory in the tree &lt;/p&gt;&lt;p&gt;&lt;strong&gt;cd ..&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Create your own shortcuts for a command &lt;/p&gt;&lt;p&gt;&lt;strong&gt;alias shortcut='full command'&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;See a list of shortcuts that you have already created.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;alias (by itself)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;----------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Search :- find, grep&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Locate a file on the shell (looking in all sub directories)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;find . -name filename -print&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;look for a file that contains a specific word and/or phrase .&lt;/p&gt;&lt;p&gt;&lt;strong&gt;grep word file(s)&lt;br /&gt;grep blowfish *&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;-------------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Getting Help :- man, apropox&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Look up in the manual for information on a command &lt;/p&gt;&lt;p&gt;&lt;strong&gt;man command&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Getting help when you have an idea of what to do but do not know what the relavent command is.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;apropos word&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;-----------------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Extract archives :- tar, unzip, gunzip&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;decompress a .tar.gz file: &lt;/p&gt;&lt;p&gt;&lt;strong&gt;tar -zxvf filename&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;decompress a .tar file:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;tar -xvf filename&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;decompress a .zip file:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;unzip filename&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;decompress a .gz file:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;gunzip filename&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;-----------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;System :- ps, kill, uptime&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Display basic information about current running processes.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ps x&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Display more detailed information about runnging processes including memory/process usage.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ps ux&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Kill a process corresponding to a PID number.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;kill -15 #PID         (Only use kill -9 #pid if your bot does not respond to a kill -15 #pid signal)&lt;br /&gt;kill -9 #PID&lt;br /&gt;kill -9  11542&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;Kill / Terminate all running processes in your account.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;kill -15 -1&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;kill -9 -1&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The uptime shell command shows the time since the system was last booted, the number of active user processes and a final column showing something called load averages. The 3 Values for load averages are taken from the last 1, 5 and 15 minutes and represent CPU utilisation.Ideally a load average below 1 is ideal, when you start to commonly see averages above 2 you should consider investing in a new server or upgrades to current hardware. You will notice high load average by poor response times from the machine.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;uptime&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;-----------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Chmod :-&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Chmod changes the access privaledges on a file making it readable, writable and/or executable. It defines which users may have access to a file and how much access they have.&lt;/p&gt;&lt;p&gt;This column shows what access a file already has and is split into 3 sections, which can be represented by letters.&lt;/p&gt;&lt;p&gt; User  Group Others/Everyone&lt;/p&gt;&lt;p&gt;- rw-   r--   r--&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;u The User who owns the file (this means “you.”)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;g The Group the file belongs to.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;o The Other users.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;a All of the above (an abbreviation for ugo)&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To change the access permissions of a file you use the command chmod as discussed a little later.&lt;/p&gt;&lt;p&gt;Letter Correspnding Number  Definition&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;r 1 Permission to Read a file (list a directory).&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;p&gt;&lt;br /&gt;w 2 Permission for Writing to and deleting files and/or directories.&lt;/p&gt;&lt;/strong&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;x 4 Permission to eXecute (run) a file.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The octal (0-7) value is calculated by adding up the values for each digit&lt;/p&gt;&lt;p&gt;&lt;strong&gt;User (rwx) = 4+2+1 = 7&lt;br /&gt;Group(rx) = 4+1 = 5&lt;br /&gt;Others (rx) = 4+1 = 5&lt;br /&gt;chmod mode = 755&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;change the permissions on a file.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;chmod who=permission(s) filename&lt;br /&gt;chmod numbers filename&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;We will show you some examples of both these mothods using this file: &lt;/p&gt;&lt;p&gt;permissions before Commands permissions after&lt;br /&gt;&lt;strong&gt;-rwxr-xr-x  chmod 700 file.conf -rwx------&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;-rwxr-xr-x chmod go= file.conf -rwx------&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;-rwxr-xr-x chmod u=rw file.conf -rw-r-xr-x&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;-rwxr-xr-x chmod 555 file.conf -r-xr-xr-x&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Personally i prefer using the numbers as opposed to letters to represent permissions on a file.&lt;/p&gt;&lt;p&gt;---------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;About yourself :-  whoami, passwd, quota, du, last&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Display what username you are currently logged on under &lt;/p&gt;&lt;p&gt;&lt;strong&gt;whoami&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Change your password&lt;/p&gt;&lt;p&gt;&lt;strong&gt;passwd&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Display your current quota on the shell &lt;/p&gt;&lt;p&gt;&lt;strong&gt;quota -v&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Display current disk usage of a filename and/or directory. Without an option it will use the current directory. &lt;strong&gt;du -s&lt;/strong&gt; will only give a total. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;du filename/directory &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Shows a list of your last logins &lt;/p&gt;&lt;p&gt;&lt;strong&gt;last YourUsername&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;----------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Accessing external sites :- ftp, wget, lynx, telnet&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Accessing an ftp site from your shell&lt;/p&gt;&lt;p&gt;&lt;strong&gt;ftp hostname&lt;br /&gt;ftp &lt;/strong&gt;&lt;a href="ftp://ftp.url.org/"&gt;&lt;strong&gt;ftp.url.org&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;common commands to remeber using ftp are &lt;strong&gt;get, dir, cd&lt;/strong&gt;. You can type &lt;strong&gt;help command&lt;/strong&gt; at any time while using ftp on your shell.&lt;/p&gt;&lt;p&gt;Getting a file directly from an http or ftp site without logging in.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;wget file&lt;br /&gt;wget ftp://somewebsite.com/filename.zip&lt;br /&gt;wget &lt;a href="http://www.somwhere.org/download/file.tar.gz"&gt;http://www.somwhere.org/download/file.tar.gz&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Browse the web from an ordinary terminal, type H at any time to learn more about lynx&lt;/p&gt;&lt;p&gt;&lt;strong&gt;lynx&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To connect to a remote host you can use telnet as follows:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;telnet hostname&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;--------------------&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Please report inaccuracies or errors that I have made to &lt;a href="mailto:hemant@allaboutunix.com"&gt;hemant@allaboutunix.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt; &lt;/p&gt;&lt;/strong&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt; &lt;/p&gt;&lt;/strong&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7521144173919293619-4693992455291728440?l=help-unix.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://help-unix.blogspot.com/feeds/4693992455291728440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7521144173919293619&amp;postID=4693992455291728440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/4693992455291728440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7521144173919293619/posts/default/4693992455291728440'/><link rel='alternate' type='text/html' href='http://help-unix.blogspot.com/2007/07/some-unix-commands.html' title='Some Unix Commands.'/><author><name>Hemanth</name><uri>http://www.blogger.com/profile/03062821487496192126</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
