alias

alias linux command cheatsheet by Thamizhiniyan C S

Introduction

The alias command allows the user to create replacements for other commands and make them easier to remember and use.


Syntax

alias [option] [alias]='[command-or-path]'


Important Flags

FlagDescription

-p

Print the list of currently defined aliases.

-a

Define alias for all users (must be superuser).


Examples

CommandDescription
alias

To list all available aliases on the system

alias -p

To list all available aliases on the system (Same as the above command)

alias print="echo"

Creating an alias named `print` which executes the `echo` command

alias list='ls -la'

Creating an alias named `list` which executes the `ls -la` command

unalias [alias]

To remove an alias

unalias -a

To remove all alias

Last updated