mirror of
https://github.com/nushell/nushell.git
synced 2024-11-27 10:53:57 +01:00
33 lines
560 B
Markdown
33 lines
560 B
Markdown
# alias
|
|
|
|
This command allows you to define shortcuts for other common commands. By default, they only apply to the current session. To persist them, add them to your config.
|
|
|
|
Syntax: `alias <name> = <body>`
|
|
|
|
The command expects two parameters:
|
|
|
|
* The name of the alias
|
|
* The body of the alias
|
|
|
|
## Examples
|
|
|
|
Define a custom `myecho` command as an alias:
|
|
|
|
```shell
|
|
> alias myecho = echo
|
|
> myecho "hello world"
|
|
hello world
|
|
```
|
|
|
|
The suggested help command works!
|
|
|
|
```shell
|
|
> myecho -h
|
|
|
|
Usage:
|
|
> myecho {flags}
|
|
|
|
flags:
|
|
-h, --help: Display this help message
|
|
```
|