2020-05-03 06:49:27 +02:00
# alias
2020-06-23 20:21:47 +02:00
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>`
2020-05-03 06:49:27 +02:00
2021-01-12 20:30:27 +01:00
The command expects two parameters:
2020-06-23 20:21:47 +02:00
2020-08-01 14:11:26 +02:00
* The name of the alias
2021-01-12 20:30:27 +01:00
* The body of the alias
2020-05-03 06:49:27 +02:00
## Examples
Define a custom `myecho` command as an alias:
2020-06-23 20:21:47 +02:00
2020-05-03 06:49:27 +02:00
```shell
2021-01-12 20:30:27 +01:00
> alias myecho = echo
2020-05-03 06:49:27 +02:00
> myecho "hello world"
hello world
```
The suggested help command works!
2020-06-23 20:21:47 +02:00
2020-05-03 06:49:27 +02:00
```shell
> myecho -h
Usage:
2021-01-12 20:30:27 +01:00
> myecho {flags}
2020-05-03 06:49:27 +02:00
flags:
-h, --help: Display this help message
```