Skip to content
πŸš€ Awesome .bashrc snippets/aliases that will make your day
Branch: master
Clone or download
aashutoshrathi Add ADB Screenshots (#28)
* βœ… Add ADB Screenshots

* Update id
Latest commit 76b24c0 Dec 28, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore ⚑️ Added Tests and CI (#27) Dec 25, 2018
.travis.yml ⚑️ Added Tests and CI (#27) Dec 25, 2018 Updated instructions Oct 2, 2018 Add ADB Screenshots (#28) Dec 28, 2018 ⚑️ Added Tests and CI (#27) Dec 25, 2018


πŸš€ Curated list of awesome bashrc snippets that will make your work easier.


Working with bash in daily life, it is very irritating writing the same command multiple times. To avoid that we write aliases/snippets for bashrc and make our life easier.

This repository will have collection of such aliases. Read Contribution Guidelines before contributing.


C/C++ compile and run

cpp-run() {
    echo "Compiling file..."
    g++ -o "$1" "$1.cpp"
    echo "Compiled! Enter input :D"
# cpp-run filename

c-run() {
    echo "Compiling file..."
    gcc -o "$1" "$1.c"
    echo "Compiled! Enter input :D"
# c-run filename

git diff for JS Devs

alias gd="git diff --ignore-all-space 
                    --ignore-blank-lines -- . 

# Write gd to ignore not important differences.
# Credits:

Upload your package to

This generates the respective dist files and uploads them to by asking your credentials at the end.

alias pyup="python sdist bdist_wheel && twine upload dist/*"

apt-get update

alias update='sudo apt-get update'

git branch

This will display the current git branch of any repository you're in.

# Add git branch if its present to PS1
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'

# Pass the function to the color parser of the terminal to colorize the branch name.
if [ "$color_prompt" = yes ]; then
    if [[ ${EUID} == 0 ]] ; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W $(parse_git_branch)\$\[\033[00m\] '
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w $(parse_git_branch)\$\[\033[00m\] '
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
unset color_prompt force_color_prompt alias

Get shortened URLs from a single command

gurl() {
    curl -i -F "url=$1" \
    -F "code=$2"

# Usage
# gurl anshumanv

After these steps, will redirect you to

Fast upwards navigation

alias ..='cd ..'
alias ...='cd ../../../'
alias ....='cd ../../../../'
alias .....='cd ../../../../'

Download music from youtube video

You will need mp3-lame library and youtube-dl utility.

alias youtube-mp3="youtube-dl --extract-audio --audio-format mp3"
# Usage
# youtube-mp3{id}

Get saved WiFi keys

alias wifikey="sudo grep -r '^psk=' /etc/NetworkManager/system-connections/"
# Usage (requires sudo)
# wifikey

Take Screenshot of connected ADB Device

alias cap="adb shell screencap -p /sdcard/screen.png && \
           adb pull /sdcard/screen.png && \
           adb shell rm /sdcard/screen.png"
# Usage (requires connected device)
# Saves the screenshot with name screen.png
# cap



File Templates taken from awesome-no-login-web-apps

Icons made by Freepik from is licensed by CC 3.0 BY
You can’t perform that action at this time.