Unix self-extracting Bourne shell archive file
File type: Archive and compressed file
A .shar file is a Unix shell archive: a self-extracting archive implemented as a Bourne shell script.
When run by a compatible shell, it recreates the files stored in the archive.
File type category:
Archive and compressed file
Date updated: October 12, 2026
The shar file extension is associated with Unix and the Bourne shell (sh). A shar archive is essentially a text shell script containing commands and encoded file data.
Executing the script extracts the embedded data and recreates the original files. Shar archives are not necessarily compressed, although they may be compressed or repacked as part of distribution.
The format is mainly encountered on Unix and Linux systems and is less common than modern archive formats. MIME types associated with shar files include application/x-shar, application/x-sh and application/x-bsh.
On Unix or Linux, a .shar file can be opened by running it with a Bourne-compatible shell. Inspect the script before executing it, because it can create or overwrite files and may contain other shell commands.
On Microsoft Windows, ZipZag can extract shar archives. Some other Windows file managers may also support this format.
A shar file does not usually need conversion. Extract it with a Bourne-compatible shell or ZipZag, then create an archive in another format from the resulting files.
There is no need to convert the shell script itself when the goal is simply to recover its contents.