Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-10-2024, 08:21 AM
|
#1
|
|
Member
Registered: Oct 2022
Posts: 93
Rep:
|
How come TAR use octal numbers instead of decimal numbers?
[ Log in to get rid of this advertisement]
What is the benefit of using octal numbers? Isn't it rather confusing?
TAR is the only file format I am aware of which uses base 8 to encode numbers. Octal is neither space-efficient nor human-friendly.
Since TAR is an ancient format, could it be that computers from the 1970 and 1980 were better at dealing with octal numbers? It's the most plausible explanation I can think of.
|
|
|
|
06-10-2024, 08:48 AM
|
#2
|
|
Member
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish X E.
Posts: 383
Rep:
|
Octal is directly compatible with binary which basically all computers use and used. Probably easier to program with and encode and decode. Base 2 (binary) to base 8 (octal) is easier for programmers than base 10 because a power of 2 (2 to power 3) is 8. X E.
Last edited by maybeJosiah; 06-10-2024 at 08:51 AM.
|
|
|
|
06-10-2024, 10:06 AM
|
#3
|
|
Member
Registered: Oct 2022
Posts: 93
Original Poster
Rep:
|
hexadecimal
Quote:
Originally Posted by maybeJosiah
Octal is directly compatible with binary which basically all computers use and used. Probably easier to program with and encode and decode. Base 2 (binary) to base 8 (octal) is easier for programmers than base 10 because a power of 2 (2 to power 3) is 8. X E.
|
Then why wasn't hexadecimal used? Hexadecimal (base 16) is also a power of two.
|
|
|
2 members found this post helpful.
|
06-10-2024, 10:26 AM
|
#4
|
|
Member
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish X E.
Posts: 383
Rep:
|
Just an old format, tape archive (tar) may just be old and used to be used for things with fewer bits. Not an expert but I know that tar stands for tape archive which is old. X E.
|
|
|
|
06-10-2024, 10:27 AM
|
#5
|
|
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,250
|
The advantage of octal over hexadecimal is that you only need numerals. It was widely used in the early days of computing and still lingers on in Linux — see the man entry for chmod, for example.
|
|
|
2 members found this post helpful.
|
06-10-2024, 11:59 AM
|
#6
|
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,256
|
Dunno. Hewlett-Packard designed their "HP3000" family of minicomputers on a reverse-polish stack architecture, just as they did their pocket calculators. And, they also consistently used octal notation. Never knew why, exactly. But you quickly got used to it.
|
|
|
1 members found this post helpful.
|
06-10-2024, 02:00 PM
|
#7
|
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,713
|
Quote:
Originally Posted by maybeJosiah
Octal is directly compatible with binary which basically all computers use and used. Probably easier to program with and encode and decode. Base 2 (binary) to base 8 (octal) is easier for programmers than base 10 because a power of 2 (2 to power 3) is 8. X E.
|
Seriously??? Don't you claim to be an 'experienced programmer' who knows 8 of the top ten languages??? How is it 'easier' for programmers to work with, when things are written in a high-level language (like C) and compiled down?? This is another case of a utility being written a long time ago on vastly different hardware; has more to do with the PDP era machines and the size of their respective bit-blocks. Zero to do with "it's easier to divide 8 by 2". You do realize that computers do math pretty well, right???
And do you mind explaining how octal is 'directly compatible with binary'???
Quote:
|
Originally Posted by maybeJosiah
Just an old format, tape archive (tar) may just be old and used to be used for things with fewer bits. Not an expert but I know that tar stands for tape archive which is old. X E.
|
...which is pretty much what DavidMcCann said, regarding older hardware. And if you think tape isn't used any longer...you are SERIOUSLY mistaken (again).
And *STOP* with the 'XE' garbage.
|
|
|
1 members found this post helpful.
|
06-10-2024, 08:51 PM
|
#8
|
|
Member
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 653
|
Simple search with duckduckgo (no inference engine needed):
From wiki:
Octal became widely used in computing when systems such as the UNIVAC 1050, PDP-8, ICL 1900 and IBM mainframes employed 6-bit, 12-bit, 24-bit or 36-bit words. Octal was an ideal abbreviation of binary for these machines because their word size is divisible by three (each octal digit represents three binary digits). So two, four, eight or twelve digits could concisely display an entire machine word. It also cut costs by allowing Nixie tubes, seven-segment displays, and calculators to be used for the operator consoles, where binary displays were too complex to use, decimal displays needed complex hardware to convert radices, and hexadecimal displays needed to display more numerals.
--
Looking over at my PDP 11/70 front panel, all the switches are in 3 digit groups (octal). Just the way it was. Octal is no harder to learn than binary, base 10, base 16 (hex).... That said this was a 16 bit Word machine (unlike earlier 12 bit PDP-8 for example), but had 22 bit memory management. The memory management could translate 18bit Unibus map addresses to 22 bits. Seems a bit complicated looking back  .
Hope that helps 
Last edited by rclark; 06-10-2024 at 09:15 PM.
|
|
|
1 members found this post helpful.
|
06-13-2024, 07:19 PM
|
#9
|
|
Senior Member
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,850
|
Quote:
Originally Posted by rclark
Looking over at my PDP 11/70 front panel, all the switches are in 3 digit groups (octal).
|
Off-topic but if you have an 11/70 front panel laying around, you might find the PiDP-11 project/kit interesting. Someone with 11/70 maintenance prints and some hardware skills ought to be able to bring a real 11/70 console back to a functional life. (I've got an old RPi 2 looking for a purpose in life and it'd be fun to dive into RSX-11M-PLUS again.)
|
|
|
|
06-13-2024, 07:59 PM
|
#10
|
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352
|
There was a time when people programmers worked with octal so much that they found themselves balancing their checkbooks in octal. No doubt it's a holdover from those days.
|
|
|
|
06-13-2024, 08:44 PM
|
#11
|
|
Member
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 653
|
Quote:
|
the PiDP-11 project/kit interesting.
|
I should have said my 1/3 size PDP 11/70 front panel powered by a RPI-5  . Great kit. Looking at the new PiDP-10 as another project  .
|
|
|
|
All times are GMT -5. The time now is 03:40 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|