Longest Command In Crosh Apr 2026

So, what happens when you try to break them? What is the you can type before Crosh gives up?

But if you are writing a script that generates a massive one-liner inside Crosh (e.g., a very long for loop), remember the magic number: . The Longest Command Ever (Recorded) Here it is, abbreviated for sanity:

I decided to find out. In a standard Bash shell on Linux, the limit is usually around 128KB to 1MB (defined by ARG_MAX ). Crosh, however, is different. It is built on ash (Almquist shell) with a custom frontend running inside the Chrome browser process.

Crosh doesn't crash—it simply respects the POSIX ARG_MAX limit. Chrome OS’s little debug shell is more robust than it looks. longest command in crosh

The command:

Why this number? It is a classic computing limit: (the maximum value of a signed 16-bit integer).

If you have ever opened crosh (Ctrl+Alt+T) on a Chromebook, you know it’s not a full Linux terminal. It’s a restricted shell designed for debugging, network diagnostics, and ping tests. But every shell has limits. So, what happens when you try to break them

bash: /bin/echo: Argument list too long The echo command is a built-in in many shells, but in Crosh's restricted environment, echo often forks to /bin/echo . That hits ARG_MAX .

Result: The cursor froze. Crosh did not crash, but it stopped accepting keyboard input for 3 seconds. After processing, the command executed.

# Generate a 32,767-character argument printf 'A%.0s' 1..32767 | xargs -0 echo Note: The above command requires xargs , which may not be available in stock Crosh. You have been warned. Did I miss a longer command? Do you know a hidden built-in that bypasses the limit? Let me know in the comments. The Longest Command Ever (Recorded) Here it is,

For example, using a printf built-in (or just pressing Tab to trigger auto-complete), the buffer limit becomes —that is 2^17 - 1 .

Result: Error. Argument list too long .

However, if you use a that doesn't require forking, the limit changes.

echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... (32,767 times) 0 Execution time: ~400ms (mostly rendering) Shell sanity after execution: Intact. Final Verdict The longest command in Crosh is 32,767 characters using an external binary, or 131,071 characters using a shell built-in.

Date: Draft Topic: Shell limits & buffer overflows in crosh

Martina Butković, Partner Certified Auditor

Martina is a partner for accounting services at Sigma Tax Consulting Ltd., 2016 – present. She has more than 30 years of experience in providing accounting services.

Prior to joining Sigma Tax Consulting, Martina worked as audit manager, director and partner in other audit companies including Big 4.

Maja Damjanović, Partner Certified Tax Advisor

Maja is partner for tax services at Sigma Tax Consulting Ltd., 2016 – present.

She has more than 20 years of experience in providing tax advisory services. In the past she worked for EY, Zgombić and Partners Ltd. (from 2003 – 2013, as a partner) and PwC (2013-2016, as a tax director).