LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 06-10-2024, 08:21 AM   #1
exerceo
Member
 
Registered: Oct 2022
Posts: 93

Rep: Reputation: 20
Question 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.
 
Old 06-10-2024, 08:48 AM   #2
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish X E.
Posts: 383
Blog Entries: 3

Rep: Reputation: 9
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.
 
Old 06-10-2024, 10:06 AM   #3
exerceo
Member
 
Registered: Oct 2022
Posts: 93

Original Poster
Rep: Reputation: 20
Question hexadecimal

Quote:
Originally Posted by maybeJosiah View Post
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.
Old 06-10-2024, 10:26 AM   #4
maybeJosiah
Member
 
Registered: Jan 2024
Location: USA
Distribution: Ubuntu, Android, Ubuntu Touch, Jolla Sailfish X E.
Posts: 383
Blog Entries: 3

Rep: Reputation: 9
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.
 
Old 06-10-2024, 10:27 AM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,250

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
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.
Old 06-10-2024, 11:59 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,256
Blog Entries: 4

Rep: Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140Reputation: 4140
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.
Old 06-10-2024, 02:00 PM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,713

Rep: Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168Reputation: 8168
Quote:
Originally Posted by maybeJosiah View Post
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.
Old 06-10-2024, 08:51 PM   #8
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 653

Rep: Reputation: 243Reputation: 243Reputation: 243
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.
Old 06-13-2024, 07:19 PM   #9
rnturn
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

Rep: Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553
Quote:
Originally Posted by rclark View Post
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.)
 
Old 06-13-2024, 07:59 PM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,352

Rep: Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386Reputation: 5386
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.
 
Old 06-13-2024, 08:44 PM   #11
rclark
Member
 
Registered: Jul 2008
Location: Montana USA
Distribution: KUbuntu, Fedora (KDE), PI OS
Posts: 653

Rep: Reputation: 243Reputation: 243Reputation: 243
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 .
 
  


Reply

Tags
archiving, tar



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BC provides incorrect decimal results, but only on the last two decimal places... standard_output Linux - Newbie 4 06-27-2012 05:30 PM
ANSI C decimal to octal SpLaSh212 Programming 14 03-07-2009 02:33 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
convert decimal to octal using the let command Suinatsa Programming 2 10-24-2006 08:42 AM
Have problem converting a decimal number to octal Linh Programming 4 05-20-2004 03:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration