1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [-p (context-dependent) (Port / Parents / Publish)](<https://delaparra-services.nl/knowledge-hub/p-context-dependent-port-parents-publish>)

  

Category: CLI flags 

# -p (context-dependent) (Port / Parents / Publish)

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is -p (context-dependent) (Port / Parents / Publish)?

 

-p (context-dependent) (Port / Parents / Publish): One of the most overloaded short flags in CLI tooling — meaning depends entirely on the command. ` -p ` is a short flag with no fixed meaning. In ` docker run -p 8080:80 ` it publishes a port. In ` mkdir -p ` it creates parent folders as needed. In ` ssh -p 2222 ` it sets the port, in ` mysql -p ` it asks for a password, and in ` git add -p ` it lets you stage a file in pieces.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about -p (context-dependent) (Port / Parents / Publish)

  

### How is -p (context-dependent) (Port / Parents / Publish) used in practice?

 

So knowing what ` -p ` did in one tool tells you nothing about the next. Read the help text, or better, use the long option where it exists, such as ` --publish ` or ` --parents `.

    

### What should you keep in mind with -p (context-dependent) (Port / Parents / Publish)?

 

The ones worth remembering are ` mkdir -p `, which makes a script safe to run twice, and ` git add -p `, which lets you split unrelated changes into separate commits. That last one makes reviews much easier, because each commit then does one thing.

 

## At a glance

   CategoryCLI flags Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More CLI flags terms

 

- [-h, --help (Help)](<https://delaparra-services.nl/knowledge-hub/h-help-help>) 
- [-i, --interactive (Interactive)](<https://delaparra-services.nl/knowledge-hub/i-interactive-interactive>) 
- [-o, --output (Output)](<https://delaparra-services.nl/knowledge-hub/o-output-output>) 
- [-q, --quiet, --silent (Quiet / Silent)](<https://delaparra-services.nl/knowledge-hub/q-quiet-silent-quiet-silent>) 
- [-r, -R, --recursive (Recursive)](<https://delaparra-services.nl/knowledge-hub/r-r-recursive-recursive>) 
- [-t, --tag, -t (tty) (Tag / Allocate TTY)](<https://delaparra-services.nl/knowledge-hub/t-tag-t-tty-tag-allocate-tty>)

 

[All terms starting with a number or symbol](<https://delaparra-services.nl/knowledge-hub#letter-other>)

 

## Skills

 

- ### CLI flag safety

 

Use before running or suggesting shell commands with flags, especially destructive or broad ones (-f/--force, -r/-R recursive, -a/--all, -y/--yes, prune, --hard), and when a user asks what a flag means (-v, -q, -n/--dry-run, -h, -o, -p, -t, -u, -w, -x, -c, -i). Explains flags per tool and prefers dry runs and narrow scopes.

 [View skill](<https://delaparra-services.nl/skills/cli-flag-safety>) [Download zip](<https://delaparra-services.nl/skills/cli-flag-safety/download>) 
- ### Docker Destructive Command Guardrails

 

Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — \`docker rm\`,

 [View skill](<https://delaparra-services.nl/skills/docker-destructive-guardrails>) [Download zip](<https://delaparra-services.nl/skills/docker-destructive-guardrails/download>) 
- ### ShellCheck Configuration and Static Analysis

 

Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuring script portability.

 [View skill](<https://delaparra-services.nl/skills/shellcheck-configuration>) [Download zip](<https://delaparra-services.nl/skills/shellcheck-configuration/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/p-context-dependent-port-parents-publish/skills.zip>)

 

## Manuals

 

- [The terminal commands you actually need](<https://delaparra-services.nl/manuals/terminalcommandos-die-je-nodig-hebt>) 
- [The terminal and PowerShell](<https://delaparra-services.nl/manuals/de-terminal-en-powershell>)

 

## Related services

 

- [Your own coding agent](<https://delaparra-services.nl/services#service-06>)

If you want to use a coding agent, we provide all the infrastructure to help it work efficiently.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/p-context-dependent-port-parents-publish)
