-
$$Temporary:$$ Applies to the current terminal session.alias shortname='long command'
- Example:
alias ll='ls -alF'
- Example:
-
$$Permanent:$$ Add the alias to your shell's configuration file (e.g.,~/.bashrc
)- Example:
$ echo "alias ll='ls -alF'" >> ~/.bashrc $ source ~/.bashrc
- Example:
alias proj='cd /path/to/your/project'
alias docs='cd ~/Documents'
alias dls='cd ~/Downloads'
alias update='sudo apt update && sudo apt upgrade -y'
alias duh='du -h --max-depth=1 | sort -hr'
alias gs='git status'
alias ga='git add'
alias gc='git commit -m'
alias gp='git push'
alias gl='git log'
alias gb='git branch'
alias gco='git checkout'
alias gpl='git pull'
- Use
gs
to check the status,ga
to add changes,gc
"message" to commit, etc.
alias pingg='ping google.com'
alias myip='curl ifconfig.me'
alias ports='netstat -tulanp'
- Use
pingg
to check connectivity,myip
to get your public IP,ports
to list open ports.
source ~/.bashrc