2014-02-21 21:18:09 +00:00
|
|
|
# alias
|
|
|
|
|
2024-04-18 05:04:00 +01:00
|
|
|
> Create aliases - words that are replaced by a command string.
|
2021-03-30 19:57:29 +01:00
|
|
|
> Aliases expire with the current shell session unless defined in the shell's configuration file, e.g. `~/.bashrc`.
|
|
|
|
> More information: <https://tldp.org/LDP/abs/html/aliases.html>.
|
2014-02-21 21:18:09 +00:00
|
|
|
|
2019-05-15 00:05:57 +01:00
|
|
|
- List all aliases:
|
|
|
|
|
|
|
|
`alias`
|
|
|
|
|
2016-01-16 14:12:05 +00:00
|
|
|
- Create a generic alias:
|
2014-02-21 21:18:09 +00:00
|
|
|
|
|
|
|
`alias {{word}}="{{command}}"`
|
|
|
|
|
2017-01-04 21:52:02 +00:00
|
|
|
- View the command associated to a given alias:
|
|
|
|
|
|
|
|
`alias {{word}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Remove an aliased command:
|
2014-02-21 21:18:09 +00:00
|
|
|
|
|
|
|
`unalias {{word}}`
|
|
|
|
|
2019-04-10 23:39:39 +01:00
|
|
|
- Turn `rm` into an interactive command:
|
2014-02-21 21:18:09 +00:00
|
|
|
|
2022-01-18 13:28:40 +00:00
|
|
|
`alias {{rm}}="{{rm --interactive}}"`
|
2014-02-21 21:18:09 +00:00
|
|
|
|
2022-01-18 13:28:40 +00:00
|
|
|
- Create `la` as a shortcut for `ls --all`:
|
2014-02-21 21:18:09 +00:00
|
|
|
|
2022-01-18 13:28:40 +00:00
|
|
|
`alias {{la}}="{{ls --all}}"`
|