Skip to content

BASH (.bash)

.bash file signature | application/x-sh

Safe

Magic Bytes

Offset 0
23 21 2F

Sources: Apache Tika

All Known Signatures

4 signature variants are documented for .bash files across multiple sources.

Hex Signature Offset Sources
23 21 2F 0 Apache Tika
23 21 20 2F 0 Apache Tika
23 21 09 2F 0 Apache Tika
65 76 61 6C 20 22 65 78 65 63 0 Apache Tika

Extension

.bash

MIME Type

application/x-sh

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .bash files in Python

Python
def is_bash(file_path: str) -> bool:
    """Check if file is a valid BASH by magic bytes."""
    signature = bytes([0x23, 0x21, 0x2F])
    with open(file_path, "rb") as f:
        return f.read(3) == signature

How to validate .bash files in Node.js

Node.js
function isBASH(buffer: Buffer): boolean {
  const signature = Buffer.from([0x23, 0x21, 0x2F]);
  return buffer.subarray(0, 3).equals(signature);
}

How to validate .bash files in Go

Go
func IsBASH(data []byte) bool {
    signature := []byte{0x23, 0x21, 0x2F}
    if len(data) < 3 {
        return false
    }
    return bytes.Equal(data[:3], signature)
}

API Endpoint

GET /api/v1/bash
curl https://filesignature.org/api/v1/bash

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .bash file?

A .bash file is a BASH file.

What are the magic bytes for .bash files?

The magic bytes for BASH files are 23 21 2F at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .bash file?

To validate a .bash file, read the first bytes of the file and compare them against the known magic bytes (23 21 2F) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .bash files?

The primary MIME type for .bash files is application/x-sh.

Is it safe to open .bash files?

BASH (.bash) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.