Skip to content

Instantly share code, notes, and snippets.

@MeAmarP
Created October 17, 2024 14:44
Show Gist options
  • Save MeAmarP/3dabe44aed1f5aced87b6ed5d8a0407d to your computer and use it in GitHub Desktop.
Save MeAmarP/3dabe44aed1f5aced87b6ed5d8a0407d to your computer and use it in GitHub Desktop.
Essential Linux Aliases for Custom Commands

Most helpful Linux Custom Commands to boost productivity using 'alias'

Options to create

  1. $$Temporary:$$ Applies to the current terminal session.alias shortname='long command'
    • Example: alias ll='ls -alF'
  2. $$Permanent:$$ Add the alias to your shell's configuration file (e.g., ~/.bashrc)
    • Example:
      $ echo "alias ll='ls -alF'" >> ~/.bashrc
      $ source ~/.bashrc
      

Directory Navigation:

alias proj='cd /path/to/your/project'
alias docs='cd ~/Documents'
alias dls='cd ~/Downloads'

System Update and Upgrade

alias update='sudo apt update && sudo apt upgrade -y'

Disk Usage-Human readable format

alias duh='du -h --max-depth=1 | sort -hr'

Git

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.

Network related

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.

$$Remember$$: After adding these aliases and functions, reload your shell configuration: source ~/.bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment