DELAPARRA
Index
Color
NL
Category: CLI flags

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

Explained by Updated

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, CC 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
Updated

More CLI flags terms

All terms starting with a number or symbol

Skills

Download all skills (zip)

Manuals

Related services

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.