← 返回命令列表

Linux command

xonsh 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start xonsh

xonsh

Run command

xonsh -c "[print('hello')]"

Run script

xonsh [script.xsh]

Interactive Python mode

xonsh -i

说明

xonsh is a cross-platform shell that combines the capabilities of Python with the familiarity of traditional Unix shells. It allows users to seamlessly mix Python expressions and standard shell commands in the same session, using Python syntax as the primary language while supporting conventional shell operations. The shell provides context-aware tab completion, syntax highlighting, and a customizable prompt. Shell commands run natively, and Python code can be used anywhere for variable manipulation, control flow, and data processing. Scripts use the .xsh extension and can contain both Python and shell syntax. xonsh runs on any platform where Python is available, making it a portable choice for users who want Python's expressiveness integrated directly into their shell workflow.

参数

-c _CMD_
Execute command.
-i
Interactive mode.
--login
Login shell.
--help
Show help.

FAQ

What is the xonsh command used for?

xonsh is a cross-platform shell that combines the capabilities of Python with the familiarity of traditional Unix shells. It allows users to seamlessly mix Python expressions and standard shell commands in the same session, using Python syntax as the primary language while supporting conventional shell operations. The shell provides context-aware tab completion, syntax highlighting, and a customizable prompt. Shell commands run natively, and Python code can be used anywhere for variable manipulation, control flow, and data processing. Scripts use the .xsh extension and can contain both Python and shell syntax. xonsh runs on any platform where Python is available, making it a portable choice for users who want Python's expressiveness integrated directly into their shell workflow.

How do I run a basic xonsh example?

Run `xonsh` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c _CMD_ do in xonsh?

Execute command.