DEV Community

loading...

Most Used 10 Terminal Aliases on Linux

ksckaan1 profile image Kaan Kuscu ・1 min read

In post, i will show you most used 10 Linux terminal aliases.

What is alias?

Alias is short way of writing commands on terminal.

How to add aliases?

This process is change according to your command shell.
If you are using bash (mostly used), you can add aliases to ~/.bashrc file.
If you are using Fish, you an add aliases yo ~/.config/fish/config.fish file.

1) alias c="clear" - write c for clear

2) alias r="source ~/.bash_profile" - write r for reload bash

3) alias del="rm -rf" - write del for recursive and force removing process.

4) alias untar="tar -zxvf" write untar filename for unpack tar file

5) For update commands
alias update="sudo apt-get update" for Debian based (Ubuntu...)
alias update="sudo pacman -Syyu" for Arch Linux based (Manjaro Linux...)
alias update="yum update" for Red Hat based (Fedora, CentOS, RHEL)

6) For installing an application
alias app="sudo apt-get install" for Debian based
alias pac="sudo pacman -S" for Arch Linux based.
alias app="dnf install" for RHEL based.

7) Git add and commit
gac "your message"
alias gac="git add . && git commit -a -m "

8) Install node packages
nis packagename
alias nis="npm install --save"

9) Make and enter inside a directory
mkcd foldername
alias mkcd='foo(){ mkdir -p "$1"; cd "$1" }; foo '

10) Control cd command behavior
alias cd.1="cd .."
alias cd.2="cd ../.."
alias cd.3="cd ../../.."
alias cd.4="cd ../../../.."
alias cd.5="cd ../../../../.."
alias cd.6="cd ../../../../../.."

Discussion (0)

pic
Editor guide