Categories: How-To

Are you familiar with the Alias command?

An important feature of the shell is the possibility of creating nicknames or shortcuts for commands. It can be used to simplify commands with many options or execute several processes in sequence.

The alias creates these shortcuts:

# alias psuira=’ps aux |grep uira’

# pust

root 1200 0.0 1.3 5040 1752? At 10:17 12:00 sshd: listen @pts /4

uira 1201 0.0 1.3 2872 1656 pts/4 S 10:18 0:00 -bash

root 2657 0.0 0.4 1764 552 pts/4 S 21:19 0:00 grep uira

In this example, the nickname psuira corresponds to the ps aux | grep uira commands.

The list of nicknames can be displayed with the alias command without any parameters:

# alias

alias +=’pushd. ‘

alias -=’popd’

alias.. =’cd.. ‘

alias… =’cd../.. ‘

alias beep=’echo -in “ 007” ‘

Alias dir=’ls -l’

alias l=’ls -AlF’

alias la=’ls -la’

alias ll=’ls -l’

alias ls=’/bin/ls $LS_OPTIONS’

alias ls-l=’ls -l’

alias lsw=’ls -l |more’

alias md=’mkdir -p’

alias o=’less’

alias psuira=’ps aux |grep uira’

alias rd=’rmdir’

alias rehash=’hash -r’

alias unmount=’echo “Error: Try the command: umount” 1>&2; false’

alias which=’type -p’

alias you=’yast2 online_update’

Learn much more about Linux in our online course. You can enroll here with a free 7-day trial. If you already have an account, you can log in here.

Did you like it? Share 🙂

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Recent Posts

Sudo command on Linux (privilege scale) [Basic Guide]

The sudo command on Linux executes a given command as if it were another user.…

2 years ago

SS command on Linux (investigate the network) [Basic Guide]

The ss command on Linux is extremely useful for investigating sockets, providing various information about…

2 years ago

Free Linux command (memory usage) [Basic Guide]

Free Linux command shows the amount of total memory in use and available, as well…

2 years ago

Linux while command (loop – while) [Basic Guide]

The shell has structures for testing conditions and executing certain program sequences several times (loop),…

2 years ago

Linux fstab file (disk mount setup) [Basic Guide]

The /etc/fstab file stores the configuration of which devices should be mounted and what is…

2 years ago

Netcat command on Linux (Swiss network knife) [Basic Guide]

The Netcat Command in Linux or nc is a utility used to do “almost anything”…

2 years ago

This website uses cookies.