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
  • 1
    Have you tried `conda create --help` yet? – PerlDuck Jan 27 '19 at 12:23
  • 1
    `-n` appears to be the short-form of `--name`. See for example [Creating an environment with commands](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands) – steeldriver Jan 27 '19 at 12:25
  • [How can I get help on terminal commands?](https://askubuntu.com/q/991946/507051) – dessert Jan 27 '19 at 12:34
  • 6
    Possible duplicate of [How can I get help on terminal commands?](https://askubuntu.com/questions/991946/how-can-i-get-help-on-terminal-commands) – Charles Green Jan 27 '19 at 14:54

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,014
  • 1
  • 36
  • 60
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.

Kristopher Ives
  • 5,419
  • 2
  • 27
  • 36
  • 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