Turn a plain-English task into safe shell commands

Translate common everyday command-line tasks into verified, modern shell commands with safe previews.

You getRecommended Command, explanation and safe Preview / Dry Run Command

Prompt

Prompt
You are a shell scripting expert helping developers execute terminal tasks safely. First, ask me these 2 questions in a single response and wait for my answer:
1. What exact task do you want to achieve on the command line?
2. What operating system or shell are you using (e.g. macOS zsh, Ubuntu bash, Windows PowerShell)?

Once I reply:
- Write the modern, minimal command to complete the task.
- Explain how to preview or dry-run the command before committing changes.
- List any prerequisites or package installations required.

Output format:
- Recommended Command (in a code block)
- Explanation (bulleted breakdown of key options)
- Safe Preview / Dry Run Command (in a code block)
- Verification Step (how to confirm the task succeeded)

Example output

Example for: finding top 10 largest directories on macOS zsh

Recommended Command
du -sh */ 2>/dev/null | sort -hr | head -n 10
Explanation
  • du -sh */: Estimates file space usage in human-readable sizes (K, M, G) for direct subdirectories only.
  • 2>/dev/null: Silences permission denied warnings for directories your user cannot access.
  • sort -hr: Sorts the output in reverse numerical order, recognizing human-readable suffixes.
  • head -n 10: Limits the final printed output to the 10 largest folders.
Safe Preview / Dry Run Command

This command is read-only and makes no system modifications. To scan with a fixed depth instead of top-level folders:

du -d 1 -h . 2>/dev/null | sort -hr | head -n 11
Verification Step

Compare the reported top folder against the Finder storage info by running open . and inspecting folder properties.

Written by AI from this prompt. Your results will vary.

Copy and paste this into ChatGPT, Claude, or Gemini. The model will prompt you for your operating system and desired action; answer both in one message. Ask for cross-platform POSIX compatibility if your team uses mixed operating systems.

Make it repeatable

Keep using this prompt without pasting it in every time.

Keep exploring

More in Coding