.sh

What is a .sh file?

SH is a Unix shell script — automating command-line tasks, deployments, and system administration on Linux and macOS.

Use caution
Type Code
By Unix / GNU
MIME application/x-sh

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

You have a .sh file — a shell script. It's a plain text file containing commands that your terminal executes sequentially: create directories, move files, install packages, start servers, deploy applications. Shell scripts are the duct tape of software engineering — not pretty, but holding everything together.

Shell scripts run in bash, zsh, or another Unix shell. The `#!/bin/bash` line at the top (the "shebang") tells the OS which interpreter to use. The syntax is quirky — spaces in `if [ $x -eq 5 ]` are syntactically significant, variable expansion has a dozen forms, and quoting rules are a source of infinite bugs. Despite this, shell scripts remain the fastest way to automate command-line tasks, and every CI/CD pipeline runs them.

Any text editor opens .sh files. VS Code with the Bash extension provides syntax highlighting and shellcheck integration (a linter that catches common mistakes). To run: `chmod +x script.sh && ./script.sh` or `bash script.sh`. Shell scripts can do anything your user account can do — delete files, install software, modify configurations. Only run scripts from sources you trust.

Technical details
Full Name
Shell Script
MIME Type
application/x-sh
Developer
Unix / GNU
Magic Bytes
23 21
Safety
.sh requires caution. Shell scripts can execute any system command. Never run a .sh file from an untrusted source.
What opens it
Terminal (execute)
FREE macOS / Linux
Any text editor
FREE All
FAQ
What's the difference between bash and zsh?
Both are Unix shells. Bash is the traditional default on Linux. Zsh (now the default on macOS) adds better tab completion, globbing, and plugin support (Oh My Zsh). Most shell scripts work in both — use `#!/bin/bash` or `#!/bin/zsh` to be explicit.
How do I make a shell script executable?
Run `chmod +x script.sh` to add execute permission, then run it with `./script.sh`. Alternatively, `bash script.sh` runs it without needing execute permission.
Related formats