LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-13-2006, 08:40 AM   #1
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Rep: Reputation: 85
what is difference between /usr/bin/7za /usr/bin/7z


I have two binaries from the package p7zip in Ubuntu. What is the difference? Which one should be used?

Code:
ubuntu@ubuntu:/var/cache/apt/archives$ sudo updatedb;slocate 7z | grep bin
/usr/bin/7za
/usr/bin/7z
ubuntu@ubuntu:/var/cache/apt/archives$
I can see one is smaller than the other.

Code:
ubuntu@ubuntu:/var/cache/apt/archives$ ls -l /usr/bin/ | grep 7z
-rwxr-xr-x 1 root   root         39 2005-11-28 15:28 7z
-rwxr-xr-x 1 root   root     997864 2005-11-28 15:28 7za
ubuntu@ubuntu:/var/cache/apt/archives$
Compare these two.

Code:
ubuntu@ubuntu:/var/cache/apt/archives$ 7z

7-Zip 4.30 beta  Copyright (c) 1999-2005 Igor Pavlov  2005-11-18
p7zip Version 4.30 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on)

Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -l: don't store symlinks; store the files/directories they point to
  CAUTION : the scanning stage can never end because of symlinks like '..'
            (ex:  ln -s .. ldir)
  -m{Parameters}: set compression Method (see the manual)
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  (CAUTION: this flag does not do what you think, avoid using it)
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -so: write data to stdout (eg: % 7z a dummy -tgzip Doc.txt > archive.gz)
  -t{Type}: Set type of archive
  -v{Size}[b|k|m|g]: Create volumes
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -w[path]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries
and

Code:
ubuntu@ubuntu:/var/cache/apt/archives$ 7za

7-Zip (A) 4.30 beta  Copyright (c) 1999-2005 Igor Pavlov  2005-11-18
p7zip Version 4.30 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on)

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -l: don't store symlinks; store the files/directories they point to
  CAUTION : the scanning stage can never end because of symlinks like '..'
            (ex:  ln -s .. ldir)
  -m{Parameters}: set compression Method (see the manual)
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  (CAUTION: this flag does not do what you think, avoid using it)
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -so: write data to stdout (eg: % 7z a dummy -tgzip Doc.txt > archive.gz)
  -t{Type}: Set type of archive
  -v{Size}[b|k|m|g]: Create volumes
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -w[path]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries
ubuntu@ubuntu:/var/cache/apt/archives$
Also compare these two.

Code:
P7ZIP(1)                                                              P7ZIP(1)

NAME
       7-Zip - A file archiver with highest compression ratio

SYNOPSIS
       7z [adeltux] [-] [SWITCH] <ARCHIVE_NAME> <ARGUMENTS>...

DESCRIPTION
       7-Zip  is  a file archiver with the highest compression ratio. The pro‐
       gram supports 7z (that implements  LZMA  compression  algorithm),  ZIP,
       CAB,  ARJ,  GZIP,  BZIP2,  TAR,  CPIO, RPM and DEB formats. Compression
       ratio in the new 7z format is 30-50% better than ratio in ZIP format.

       7z uses plugins to handle archives.

FUNCTION LETTERS
       a      Add

       d      Delete

       e      Extract

       l      List

       t      Test

       u      Update

       x      eXtract with full paths

SWITCHES
Code:
P7ZIP(1)                                                              P7ZIP(1)

NAME
       7-Zip - A file archiver with highest compression ratio

SYNOPSIS
       7za [adeltux] [-] [SWITCH] <ARCHIVE_NAME> <ARGUMENTS>...

DESCRIPTION
       7-Zip  is  a file archiver with the highest compression ratio. The pro‐
       gram supports 7z (that implements  LZMA  compression  algorithm),  ZIP,
       CAB,  ARJ,  GZIP,  BZIP2,  TAR,  CPIO, RPM and DEB formats. Compression
       ratio in the new 7z format is 30-50% better than ratio in ZIP format.

       7za is a stand-alone executable. 7za handles less archive formats  than
       7z, but does not need any others.

FUNCTION LETTERS
       a      Add

       d      Delete

       e      Extract

       l      List

       t      Test

       u      Update

       x      eXtract with full paths

SWITCHES
that is just part of the man pages. the man pages are too long to list them both here.
 
Old 08-13-2006, 09:12 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Type "file /usr/bin/7z" and "file/usr/bin/7za".

If you see "ascii" or "text" or "script" you can cat the file to see what is in it. If you see ELF it is a binary. (You can use strings to see text embedded but it usually isn't much help.)

Given that 7z is only 39 bytes my guess is that it is just a script that calls 7za. Sometimes files do different things based simply on the name and it may be that you see the "(A)" stuff in the usage only because you called it with name 7za directly. If so copying 7za to 7zb and running the latter might make it replace the "(A)" stuff in usage with "(B)" stuff or might make it just not work because its an unexpected name.

Haven't used 7z or 7za myself.
 
Old 08-13-2006, 09:16 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Also answered this in your other thread:

7za is a stand-alone executable. 7za handles less archive formats than 7z, but does not need any others.
 
Old 08-13-2006, 09:31 AM   #4
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Original Poster
Rep: Reputation: 85
ubuntu@ubuntu:~$ file /usr/bin/7z
/usr/bin/7z: Bourne shell script text executable
ubuntu@ubuntu:~$ file /usr/bin/7za
/usr/bin/7za: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped
ubuntu@ubuntu:~$ cat /usr/bin/7z
#! /bin/sh
exec /usr/lib/p7zip/7z "$@"
ubuntu@ubuntu:~$ ls -l /usr/lib/p7zip/
7z Codecs/ Formats/
ubuntu@ubuntu:~$ ls -l /usr/lib/p7zip/7z
-rwxr-xr-x 1 root root 350980 2005-11-28 15:28 /usr/lib/p7zip/7z
ubuntu@ubuntu:~$
 
Old 08-13-2006, 10:30 AM   #5
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Original Poster
Rep: Reputation: 85
ubuntu@ubuntu:~$ file /usr/lib/p7zip/7z
/usr/lib/p7zip/7z: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped
ubuntu@ubuntu:~$

what is the difference between /usr/lib/p7zip/7z and /usr/bin/7za?
 
Old 08-13-2006, 10:31 AM   #6
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Original Poster
Rep: Reputation: 85
ubuntu@ubuntu:~$ file /usr/lib/p7zip/7z
/usr/lib/p7zip/7z: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped
ubuntu@ubuntu:~$

what is the difference between /usr/lib/p7zip/7z and /usr/bin/7za?
 
Old 08-13-2006, 10:37 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Like I said before:

7za is a standalone version, 7z is not (needs other progs to be able to run/use certain options).
 
Old 08-13-2006, 11:10 AM   #8
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Original Poster
Rep: Reputation: 85
Which one should I use? 7za?

Last edited by fakie_flip; 08-13-2006 at 11:14 AM.
 
Old 08-13-2006, 11:27 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

7za would be best, but it supports less archives then 7z. You could end up having to do it a second time with 7z.

If you don't mind the (minimal) extra time to execute: Use 7z for all cases.

Hope this helps.
 
Old 08-14-2006, 09:22 PM   #10
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Original Poster
Rep: Reputation: 85
I only got p7zip to use with the archives that have the highest compression ratio using the best algorithm. Do they both work for the archives that look like this?
archive.7z
 
  


Reply



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
Ubuntu 5.10 -> 6.06: diversion of /usr/bin/ldd to /usr/bin/ldd.amd64 by ia32-libs HellSpawn Linux - Software 2 06-04-2006 09:18 PM
Difference in /bin and /usr/bin tarheel92x Linux - Newbie 2 01-28-2006 09:06 AM
Difference between /usr and /bin binarybob0001 Linux - Newbie 6 07-04-2005 07:52 PM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM
/usr/bin/X11/ and /usr/X11R6/bin/ the same? linuxtesting2 Linux - Newbie 2 11-16-2004 10:57 AM

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

All times are GMT -5. The time now is 08:09 PM.

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