[Tutor] What are all those letters after terminal commands?

Steven D'Aprano steve at pearwood.info
Thu Aug 23 18:59:26 CEST 2012


On 23/08/12 23:18, Cecilia Chavana-Bryant wrote:
[...]
> I found this command:
> mkdir -p i/like/icecream. I am guessing that the -p stands for directory
> path?

Ha, that's the trouble with command line interfaces -- they tend to end up
being cryptic and painfully terse. In this case, -p actually stands for
"parents", in the sense that mkdir is trying to create the folder "icecream"
inside the parent folder "like", inside the grandparent folder "i". If any
of the parent folders are missing, the -p option says to create the missing
folders.

I don't want to put you off learning about the command line, because
knowledge is good. I've never learned something and then thought "I wish
I was more ignorant". But honestly, you don't need to be a command line
expert to make use of Python's interactive interpreter. To get started,
all you need is one command:

python


and then press the ENTER key. That brings up Python's interactive
interpreter, which uses Python syntax rather than the shell's rather
cryptic commands and options.

(Of course, the python command also takes a bunch of optional, and
useful. command switches, but you can learn them as you go.)

By all means continue with the command line book if you are getting
something useful out of it, but don't think you *have* to learn the
shell in order to use Python. The two are independent.



-- 
Steven


More information about the Tutor mailing list