tldr/pages/common/alias.md

29 lines
546 B
Markdown
Raw Normal View History

# alias
> Creates aliases -- words that are replaced by a command string.
> Aliases expire with the current shell session, unless they're defined in the shell's configuration file, e.g. `~/.bashrc`.
2019-05-15 00:05:57 +01:00
- List all aliases:
`alias`
- Create a generic alias:
`alias {{word}}="{{command}}"`
- View the command associated to a given alias:
`alias {{word}}`
- Remove an aliased command:
`unalias {{word}}`
- Turn `rm` into an interactive command:
`alias {{rm}}="{{rm -i}}"`
- Create `la` as a shortcut for `ls -a`:
2015-10-22 08:31:52 +01:00
`alias {{la}}="{{ls -a}}"`