About this Bash playground
This is an online Bash shell you can use straight away. Write a script in the editor, press Run, and the output appears next to it: everything it echoes, any error, its exit code, and how long it took.
Your script runs with Bash 5.1 on Linux, in an isolated sandbox on our servers, with the everyday Unix tools on hand. It is free, with nothing to install and no account needed.
What you can run
- Bash 5.1, running one file per run, saved as
main.sh. - Standard library only. Bash's own builtins, plus the everyday Unix tools: grep, sed, awk, sort, uniq, cut, tr, wc, head, tail, find, xargs, date, seq, jq and the rest of the core file and text utilities. Other programs, such as python or curl, are not on the PATH. There is no package installer, and programs have no network access.
- Limits: 10 seconds and 256 MB of memory per run. Output past 64 KB is cut off, code can be up to 64 KB and input up to 16 KB.
- Fair use: 5 runs a minute and 50 a day without an account, 10 a minute when you are signed in.
Reading input
Open the Input box under the editor and type what your script should read. Each read takes the next line. With the box empty, read finds nothing and returns a non-zero status.
read -r name
Frequently asked questions
Is this online Bash compiler free?
Yes. There is no sign-up and no limit on how much you can write. Signed-out visitors get a quick, usually invisible bot check when they press Run, and a fair-use cap of 5 runs a minute and 50 a day. Signing in raises it to 10 runs a minute.
Which shell does it run?
GNU Bash 5.1 on Ubuntu Linux, running your script as bash main.sh. Bash features such as arrays, [[ ]] tests, $(( )) arithmetic and functions all work. It is not zsh or fish, so their own syntax does not.
Which commands can I use?
Bash's builtins and the common text and file tools: grep, sed, awk, sort, uniq, cut, tr, wc, head, tail, find, xargs, diff, date, seq, jq and the rest of coreutils. There is no sudo or apt, no python or node, and no network, so curl, wget and ping are not available.
Can my script create files?
Yes, in the folder it runs in: echo hi > notes.txt, mkdir and mktemp all work there. Nothing else on the system is writable, and the folder is deleted when the run ends, so files do not carry over to the next run.
Why did my script stop with a time-out?
Each run gets 10 seconds and 256 MB of memory. A program that goes past either is stopped. The usual cause is a while loop whose condition never changes, or a read waiting for a line that is not in the Input box.
Is my code saved or shared?
Your code is kept in your own browser so it is still there next time, and nowhere else. When you press Run it is sent to our code runner, run once in a sandbox, and thrown away. We do not store it or show it to anyone.