<commit_before>.. _basic-usage:

Basic usage
=====================

The ``spack`` command has many *subcommands*.  You'll only need a
small subset of them for typical usage.


Listing available packages
------------------------------

To install software with Spack, you need to know what software is
available.  You can see a list of available package names at the
:ref:`package-list` webpage, or using the ``spack list`` command.

.. _spack-list:

``spack list``
~~~~~~~~~~~~~~~~

The ``spack list`` command prints out a list of all of the packages
Spack can install:

.. command-output:: spack list

The packages are listed by name in alphabetical order.  If you specify a
pattern to match, it will follow this set of rules.  A pattern with no
wildcards, ``*`` or ``?``, will be treated as though it started and ended iwth
``*``, so ``util`` is equivalent to ``*util*``.  A pattern with no capital
letters will be treated as case-insensitive. You can also add the ``-i`` flag
to specify a case insensitive search, or ``-d`` to search the description of
the package in addition to the name.  Some examples:

All packages whose names contain "sql" case insensitive:

.. command-output:: spack list sql

All packages whose names start with a capital M:

.. command-output:: spack list M*

All packages whose names or descriptions contain Documentation:

.. command-output:: spack list -d Documentation

All packages whose names contain documentation case insensitive:

.. command-output:: spack list -d documentation

.. _spack-info:

``spack info``
~~~~~~~~~~~~~~~~

To get more information on a particular package from `spack list`, use
`spack info`.  Just supply the name of a package:

.. command-output:: spack info mpich

Most of the information is self-explanatory.  The *safe versions* are
versions that Spack knows the checksum for, and it will use the
checksum to verify that these versions download without errors or
viruses.

:ref:`Dependencies <sec-specs>` and :ref:`virtual dependencies
<sec-virtual-dependencies>` are described in more detail later.<commit_msg>adding quotes to make sure the glob is interpreted correctly<commit_after>.. _basic-usage:

Basic usage
=====================

The ``spack`` command has many *subcommands*.  You'll only need a
small subset of them for typical usage.


Listing available packages
------------------------------

To install software with Spack, you need to know what software is
available.  You can see a list of available package names at the
:ref:`package-list` webpage, or using the ``spack list`` command.

.. _spack-list:

``spack list``
~~~~~~~~~~~~~~~~

The ``spack list`` command prints out a list of all of the packages
Spack can install:

.. command-output:: spack list

The packages are listed by name in alphabetical order.  If you specify a
pattern to match, it will follow this set of rules.  A pattern with no
wildcards, ``*`` or ``?``, will be treated as though it started and ended iwth
``*``, so ``util`` is equivalent to ``*util*``.  A pattern with no capital
letters will be treated as case-insensitive. You can also add the ``-i`` flag
to specify a case insensitive search, or ``-d`` to search the description of
the package in addition to the name.  Some examples:

All packages whose names contain "sql" case insensitive:

.. command-output:: spack list sql

All packages whose names start with a capital M:

.. command-output:: spack list 'M*'

All packages whose names or descriptions contain Documentation:

.. command-output:: spack list -d Documentation

All packages whose names contain documentation case insensitive:

.. command-output:: spack list -d documentation

.. _spack-info:

``spack info``
~~~~~~~~~~~~~~~~

To get more information on a particular package from `spack list`, use
`spack info`.  Just supply the name of a package:

.. command-output:: spack info mpich

Most of the information is self-explanatory.  The *safe versions* are
versions that Spack knows the checksum for, and it will use the
checksum to verify that these versions download without errors or
viruses.

:ref:`Dependencies <sec-specs>` and :ref:`virtual dependencies
<sec-virtual-dependencies>` are described in more detail later.
{'fraction_non_alphanumeric': 0.11854320399904784, 'fraction_numerical': 0.0, 'mean_word_length': 4.026315789473684, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3926656', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1090, 'n_words': 582}