0

I found the following command online:

 conda create -n tensorflow_env tensorflow

What does the "-n" mean in this command?

user637140
  • 101
  • 1
  • 2

2 Answers2

2

From the documentation:

usage: conda create [-h] [--clone ENV] [-n ENVIRONMENT | -p PATH] [-c CHANNEL]
                    [--use-local] [--override-channels]
                    [--strict-channel-priority] [--no-channel-priority]
                    [--no-deps | --only-deps] [--no-pin] [--copy] [-C] [-k]
                    [--offline] [-d] [--json] [-q] [-v] [-y] [--download-only]
                    [--show-channel-urls] [--file FILE]
                    [--no-default-packages]
                    [package_spec [package_spec ...]]

...

-n, --name    Name of environment.
PerlDuck
  • 13,335
1

Every Linux command has a different set of arguments or flags - it's entirely up to the program. Some programs uses short flags like -n, some use long flags like --thingy, some use both, and some don't use "flags" at all like dd if=foo of=bar.

A common convention is for programs to list out their options when passed --help or -h, and many programs provide a Manual Page (manpage) which you can read using man name_of_command, although it looks like conda may not have one.

  • does "-" or "--" have a "terminal-wide" syntactic status? or is it also just a convention? – user637140 Jan 27 '19 at 13:02
  • It's just a convention. Many programs use it because there are libraries and tools for parsing the arguments (getopt in C, argparse in Python) and automatically generating help text or man pages. – Kristopher Ives Jan 27 '19 at 13:17
  • For example, the program you're using conda uses Python's argparse to generate that --help text. – Kristopher Ives Jan 27 '19 at 13:17