LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   what is difference between /usr/bin/7za /usr/bin/7z (https://www.linuxquestions.org/questions/linux-software-2/what-is-difference-between-usr-bin-7za-usr-bin-7z-473474/)

fakie_flip 08-13-2006 08:40 AM

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.

MensaWater 08-13-2006 09:12 AM

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.

druuna 08-13-2006 09:16 AM

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.

fakie_flip 08-13-2006 09:31 AM

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:~$

fakie_flip 08-13-2006 10:30 AM

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?

fakie_flip 08-13-2006 10:31 AM

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?

druuna 08-13-2006 10:37 AM

Hi,

Like I said before:

7za is a standalone version, 7z is not (needs other progs to be able to run/use certain options).

fakie_flip 08-13-2006 11:10 AM

Which one should I use? 7za?

druuna 08-13-2006 11:27 AM

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.

fakie_flip 08-14-2006 09:22 PM

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


All times are GMT -5. The time now is 06:03 PM.