Shar (file format)

shar
Original author(s)James Gosling
Developer(s)Various open-source and commercial developers
Operating systemUnix, Unix-like, VMS, Windows
TypeCommand
shar
Filename extension
.shar
Type of formatArchive format, shell script
Open format?Yes[1]

In the Unix operating system, shar (from "shell archive") is an archive format created with the Unix shar utility. A shar file is a type of self-extracting archive, because it is a valid shell script, and executing it will recreate the files. To extract the files, only the standard Unix Bourne shell sh is usually required.

shar files are also sometimes called "sharchives" (from "/bin/sh archive").[2]

Note that the shar command is not specified by the Single Unix Specification, so it is not formally a component of Unix, but a legacy utility.

  1. ^ Cite error: The named reference gnu was invoked but never defined (see the help page).
  2. ^ "sharchive". ftp.informatik.rwth-aachen.de. Retrieved 2024-01-02.