2015-04-13 09:03:32 -07:00
|
|
|
.. _aliases:
|
|
|
|
|
|
|
|
********************
|
2015-09-12 20:27:21 -04:00
|
|
|
Built-in Aliases
|
2015-04-13 09:03:32 -07:00
|
|
|
********************
|
2015-09-12 20:27:21 -04:00
|
|
|
This page describes the xonsh built-in commands and aliases.
|
2015-04-13 09:03:32 -07:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``cd``
|
|
|
|
===================
|
2016-05-11 02:49:03 -04:00
|
|
|
Changes the directory. If no directory is specified (i.e. if there are no arguments)
|
2015-08-29 17:00:35 -04:00
|
|
|
then this changes to the current user's home directory.
|
2015-04-13 09:03:32 -07:00
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``pushd``
|
|
|
|
===================
|
|
|
|
Adds a directory to the top of the directory stack, or rotates the stack,
|
|
|
|
making the new top of the stack the current working directory.
|
|
|
|
|
2016-02-05 00:42:05 -05:00
|
|
|
.. command-help:: xonsh.dirstack.pushd
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``popd``
|
|
|
|
===================
|
|
|
|
Removes entries from the directory stack.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
.. command-help:: xonsh.dirstack.popd
|
|
|
|
|
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``dirs``
|
|
|
|
===================
|
2016-05-11 02:49:03 -04:00
|
|
|
Displays the list of currently remembered directories. Can also be used to clear the
|
2015-08-29 17:00:35 -04:00
|
|
|
directory stack.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
.. command-help:: xonsh.dirstack.dirs
|
|
|
|
|
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``jobs``
|
|
|
|
===================
|
|
|
|
Display a list of all current jobs.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``fg``
|
|
|
|
===================
|
|
|
|
Bring the currently active job to the foreground, or, if a single number is
|
|
|
|
given as an argument, bring that job to the foreground.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``bg``
|
|
|
|
====================
|
|
|
|
Resume execution of the currently active job in the background, or, if a
|
|
|
|
single number is given as an argument, resume that job in the background.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2021-02-09 09:54:17 -06:00
|
|
|
``disown``
|
|
|
|
==========
|
|
|
|
The behavior of this command matches the behavior of zsh's disown
|
|
|
|
command which is as follows:
|
|
|
|
|
|
|
|
Remove the specified jobs from the job table; the shell will no longer
|
|
|
|
report their status, and will not complain if you try to exit an
|
|
|
|
interactive shell with them running or stopped. If no job is specified,
|
|
|
|
disown the current job.
|
|
|
|
If the jobs are currently stopped and the $AUTO_CONTINUE option is set
|
|
|
|
($AUTO_CONTINUE = True), a warning is printed containing information about
|
|
|
|
how to make them running after they have been disowned. If one of the
|
|
|
|
latter two forms is used, the jobs will automatically be made running,
|
|
|
|
independent of the setting of the $AUTO_CONTINUE option.
|
|
|
|
|
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``EOF``, ``exit``, and ``quit``
|
|
|
|
===================================
|
2016-05-11 02:49:03 -04:00
|
|
|
The commands ``EOF``, ``exit``, and ``quit`` all alias the same action, which is to
|
|
|
|
leave xonsh in a safe manner. Typing ``Crtl-d`` is the same as typing ``EOF`` and
|
2015-08-29 17:00:35 -04:00
|
|
|
pressing enter.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2016-08-13 21:45:19 -04:00
|
|
|
``exec`` and ``xexec``
|
|
|
|
=========================
|
2020-11-25 20:08:24 +03:00
|
|
|
|
2016-08-13 21:45:19 -04:00
|
|
|
.. command-help:: xonsh.aliases.xexec
|
2015-04-13 09:03:32 -07:00
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``source``
|
|
|
|
====================
|
2016-05-11 02:49:03 -04:00
|
|
|
Executes the contents of the provided files in the current context. This, of course,
|
2015-08-29 17:00:35 -04:00
|
|
|
only works on xonsh and Python files.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``source-bash``
|
|
|
|
====================
|
2015-10-31 19:37:07 -04:00
|
|
|
Like the ``source`` command but for Bash files. This is a thin wrapper around
|
2017-06-07 11:51:06 -04:00
|
|
|
the ``source-foreign`` alias where the ``shell`` argument is automatically set
|
2016-02-05 01:25:59 -05:00
|
|
|
to ``bash``.
|
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
|
2021-11-24 09:01:42 +11:00
|
|
|
``source-zsh``
|
|
|
|
==============
|
|
|
|
Like the ``source`` command but for ZSH files. This is a thin wrapper around
|
|
|
|
the ``source-foreign`` alias where the ``shell`` argument is automatically set
|
|
|
|
to ``zsh``.
|
|
|
|
|
|
|
|
|
2015-10-31 19:37:07 -04:00
|
|
|
``source-foreign``
|
|
|
|
====================
|
2016-05-11 02:49:03 -04:00
|
|
|
Like the ``source`` command but for files in foreign (non-xonsh) languages.
|
2015-10-31 19:37:07 -04:00
|
|
|
It will pick up the environment and any aliases.
|
2015-08-29 17:00:35 -04:00
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
.. command-help:: xonsh.aliases.source_foreign
|
|
|
|
|
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``history``
|
|
|
|
====================
|
|
|
|
Tools for dealing with xonsh history. See `the history tutorial <tutorial_hist.html>`_
|
|
|
|
for more information all the history command and all of its sub-commands.
|
|
|
|
|
2016-12-14 13:42:43 -05:00
|
|
|
.. command-help:: xonsh.history.main.history_main
|
2016-02-05 01:25:59 -05:00
|
|
|
|
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``timeit``
|
|
|
|
===============
|
|
|
|
Runs timing study on arguments. Similar to IPython's ``%timeit`` magic.
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``scp-resume``
|
|
|
|
=================
|
|
|
|
Simple alias defined as ``['rsync', '--partial', '-h', '--progress', '--rsh=ssh']``.
|
|
|
|
|
2016-05-25 21:38:58 -04:00
|
|
|
``showcmd``
|
|
|
|
============
|
2017-06-07 11:51:06 -04:00
|
|
|
Displays how commands and arguments are evaluated.
|
2016-05-25 21:38:58 -04:00
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2015-08-29 17:00:35 -04:00
|
|
|
``ipynb``
|
|
|
|
=================
|
|
|
|
Simple alias defined as ``['ipython', 'notebook', '--no-browser']``.
|
|
|
|
|
2015-08-30 10:36:14 -04:00
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
``trace``
|
|
|
|
=================
|
|
|
|
Provides an interface to printing lines of source code prior to their execution.
|
|
|
|
|
2016-06-18 17:32:37 -04:00
|
|
|
.. command-help:: xonsh.tracer.tracermain
|
2016-02-05 01:25:59 -05:00
|
|
|
|
|
|
|
|
2017-07-25 14:49:54 -04:00
|
|
|
``xpip``
|
2017-01-27 22:06:35 -05:00
|
|
|
=================
|
|
|
|
Runs the ``pip`` package manager for xonsh itself. Useful for installations where xonsh is in an
|
2017-07-25 14:49:54 -04:00
|
|
|
isolated environment (eg conda, homebrew).
|
|
|
|
|
|
|
|
In general, use ``xpip`` if you're configuring or adding features to xonsh, and use ``pip`` if
|
|
|
|
you're doing Python development.
|
2017-01-27 22:06:35 -05:00
|
|
|
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
``xonfig``
|
|
|
|
=================
|
|
|
|
Manages xonsh configuration information.
|
|
|
|
|
2016-06-18 17:32:37 -04:00
|
|
|
.. command-help:: xonsh.xonfig.xonfig_main
|
2016-02-05 01:25:59 -05:00
|
|
|
|
|
|
|
|
2015-08-30 10:36:14 -04:00
|
|
|
Windows cmd Aliases
|
|
|
|
=======================
|
|
|
|
The following aliases on Windows are expanded to ``['cmd', '/c', alias]``:
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
{'cls': ['cmd', '/c', 'cls'],
|
|
|
|
'copy': ['cmd', '/c', 'copy'],
|
|
|
|
'del': ['cmd', '/c', 'del'],
|
|
|
|
'dir': ['cmd', '/c', 'dir'],
|
|
|
|
'erase': ['cmd', '/c', 'erase'],
|
|
|
|
'md': ['cmd', '/c', 'md'],
|
|
|
|
'mkdir': ['cmd', '/c', 'mkdir'],
|
|
|
|
'mklink': ['cmd', '/c', 'mklink'],
|
|
|
|
'move': ['cmd', '/c', 'move'],
|
|
|
|
'rd': ['cmd', '/c', 'rd'],
|
|
|
|
'ren': ['cmd', '/c', 'ren'],
|
|
|
|
'rename': ['cmd', '/c', 'rename'],
|
|
|
|
'rmdir': ['cmd', '/c', 'rmdir'],
|
|
|
|
'time': ['cmd', '/c', 'time'],
|
|
|
|
'type': ['cmd', '/c', 'type'],
|
|
|
|
'vol': ['cmd', '/c', 'vol'],
|
|
|
|
}
|
|
|
|
|
2016-02-05 01:25:59 -05:00
|
|
|
|
2016-05-13 14:58:36 +02:00
|
|
|
|
|
|
|
``activate``/``deactivate`` on Windows with Anaconda
|
2016-05-20 17:58:50 -04:00
|
|
|
=========================================================
|
2016-05-13 14:58:36 +02:00
|
|
|
On Windows with an Anaconda Python distribution, ``activate`` and
|
2016-05-17 13:46:10 +02:00
|
|
|
``deactivate`` are aliased to ``['source-bat activate']`` and ``['source-bat deactivate']``.
|
2016-05-20 17:58:50 -04:00
|
|
|
This makes it possible to use the same commands to activate/deactivate conda environments as
|
|
|
|
in cmd.exe.
|
2015-08-30 10:36:14 -04:00
|
|
|
|
|
|
|
|
2016-03-21 14:54:42 +02:00
|
|
|
``sudo`` on Windows
|
|
|
|
====================
|
|
|
|
On Windows, if no executables named ``sudo`` are found, Xonsh adds a ``sudo`` alias
|
|
|
|
that poly fills the "run as Admin" behavior with the help of ``ShellExecuteEx`` and
|
2016-05-11 02:49:03 -04:00
|
|
|
``ctypes``. It doesn't support any actual ``sudo`` parameters and just takes the
|
2016-03-21 14:54:42 +02:00
|
|
|
command to run.
|
|
|
|
|
|
|
|
|
2015-08-30 10:36:14 -04:00
|
|
|
``ls``
|
|
|
|
====================
|
|
|
|
The ``ls`` command is aliased to ``['ls', '--color=auto', '-v']`` normally. On Mac OSX
|
|
|
|
it is instead aliased to ``['ls', '-G']``.
|
|
|
|
|
|
|
|
|
|
|
|
``grep``
|
|
|
|
====================
|
|
|
|
The ``grep`` command is aliased to ``['grep', '--color=auto']``.
|
|
|
|
|
2016-05-11 02:49:03 -04:00
|
|
|
|
|
|
|
``xontrib``
|
|
|
|
==============
|
2022-05-05 00:32:20 +05:30
|
|
|
Manages xonsh extensions. More information is available at :doc:`tutorial_xontrib`
|