nushell/docs/commands/alias.md

33 lines
560 B
Markdown
Raw Normal View History

# alias
2021-01-13 02:46:15 +01:00
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.
2020-05-24 19:42:20 +02:00
2021-01-13 02:46:15 +01:00
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
```