Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Click Here to receive this Complete Guide absolutely free.

After looking on line at the diffrent tutorials on decimal to hex conversions, I decided that they were overly complicated. So to help some new people out I thought I would show the easy way to do this.

Code:

Here is our decimal ip address 192.168.0.1
How to convert
First start on a peace of paper and write out these numbers
128 64 32 16 8 4 2 1
what these are are the decimal values of the diffrent bits in an octet ( 8 bytes)
now on to the conversion
192
first step is start on the left hand side of our number list and subtract from the number
192
- 128
= 64
so what I am going to do here is record that there was enough to subtact 128 from 192, by placing a 1 in the
128 slot
so now my table looks like this
128 64 32 16 8 4 2 1
1
now I will subtract the next value from the remainder which is 64.
64
- 64
0
so now the table looks like this
128 64 32 16 8 4 2 1
1 1
now their is nothing left to subtract so all your other values will = 0
now you have a binary address of 11000000
these numbers from an octet which is 8 bits. To convert from hex all you need to do is divide this in to two nibbles (4 bits)
niba nibb
1100 0000
the values work the same from the right hand side it is 1 2 4 8
so nible a has the 8 and the 4 place lit up add those two numbers togeather to come up with 12
12 in hex = c
nible b has no places lit up so it is 0
0 in hex = 0
your hex value fro this number is c0
now you have 192 in decimal 11000000 in binary and c0 in hex.
now to convert hex in to decimal just follow these steps backwards....
c0
c = 12
8 4 2 1
12 - 8 = 4
8 4 2 1
1
4 - 4 = 0
8 4 2 1
1 1 0 0
0 = 0
8 4 2 1
0 0 0 0
so now you have 11000000
take your old table 128 64 32 16 8 4 2 1
1 1 0 0 0 0 0 0
128 + 64 = 192

Now you know the easy way to convert between these bases.

once again the other tutorials I have found show you how to convert to hex by dividing by 16 much more complicated in my opinion. I hope this helps.

Ok, but why would you even need to do this by hand ? What I usually do if I ever have to do it by hand is make a table of binary to hex (and of course decimal fits on there too).

Ok, but why would you even need to do this by hand ? What I usually do if I ever have to do it by hand is make a table of binary to hex (and of course decimal fits on there too).

if you follow the ccna guide lines on subnetting, this information is very useful. imo

LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.