Linux Terminal

A role-play prompt that makes the AI act as a Linux terminal, replying to each command with only the output in one code block and no explanations.

  • 🤖 ChatGPT, Claude, Gemini
  • 🗂️ Coding

Last verified: write-up checked

Prompt by f/awesome-chatgpt-prompts (GitHub) · Original source (opens in a new tab)

Linux Terminal — illustration

The prompt

prompt
I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd

What it is

This prompt tells an AI chat model to behave like a Linux terminal. The user types commands and the model replies with what the terminal should show, inside a single code block and with no explanations. Text in curly brackets is the way to speak to the model in plain English. The first command in the prompt is pwd.

Who it's for

  • People learning or practicing Linux commands in a simulated terminal
  • Developers who want a quick, low-stakes way to see what a command's output might look like
  • Users of chat-based AI models who want to try role-play prompts

Requirements

Requirements

  • Access to an AI chat model that can follow role-play instructions
  • The prompt text copied into a new conversation
  • Commands you want to type, and curly-bracket text for any plain-English instructions

Examples

Default first command: pwd

Prompt
prompt
I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd

Expected output: The model replies with a single code block containing a working-directory path, such as /home/user, and no other text.

Listing a directory, then giving an English instruction

Prompt
prompt
I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is ls -la

(follow-up message) {the home directory contains a folder named projects and a file named notes.txt}

Expected output: The model replies with a code block showing a long-format directory listing. After the curly-bracket follow-up, it should adjust the simulated contents to include the projects folder and notes.txt.

Chained commands

Prompt
prompt
I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is mkdir demo && cd demo && pwd

Expected output: The model replies with only the output of the chained commands in one code block, most likely a path ending in /demo, with no commentary.

Pros & cons

Pros

  • Pro:Output is restricted to one code block with no explanations, so replies look like a real terminal
  • Pro:Curly brackets give a clear way to talk to the model without breaking the role-play
  • Pro:It is short and easy to copy, with a single editable first command
  • Pro:Commands are never executed for real, because the model only writes what the terminal should show

Cons

  • Con:The terminal is simulated, so output is the model's prediction and may not match a real system
  • Con:The prompt does not define the user, hostname, operating system or filesystem contents, so these are left to the model
  • Con:Because no command is actually executed, it cannot replace a real shell for testing
  • Con:The model may slip out of the no-explanations rule unless the instruction is kept in the conversation

Tips

  • Use curly brackets for anything that is not a command, for example {start over with an empty home directory}
  • Keep one command per message to make the output easier to follow
  • If the model starts adding explanations, remind it in curly brackets: {reply only with terminal output in a code block}
  • Replace pwd with your own starting command if you do not want to begin there

Variations

  • Change 'linux terminal' to another environment or shell, adjusting the wording as needed
  • Use curly brackets to set a scenario, such as the files that exist or the user you are logged in as
  • Replace the first command with another command to start somewhere other than pwd