Languages
[Edit]
EN

Bash - command alias

6 points
Created by:
martineau
1170

Own alias for command can be created with alias command.

Quick solution:

alias alias_name='some_command -with arg_1 -with arg_2'

 

Practical example

Example ls alias:

alias beauty_ls='ls -alh --color --time-style=long-iso'

Where:

  • beauty_ls should be changed to your own alias name,
  • ls -alh --color --time-style=long-iso can be replaced with any command.

Note: this alias will disappear after the console will be closed.

To solve this problem put alias command into ~/.bashrc file can be used.

To remove alias use: 

unalias beauty_ls

References:

  1. https://ss64.com/bash/alias.html
  2. https://en.wikipedia.org/wiki/Alias_(command)

 

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - command alias
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join