All Projects → aashutoshrathi → awesome-bashrc

aashutoshrathi / awesome-bashrc

Licence: other
🚀 Collection of bash snippets/aliases that will save your time on the terminal

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to awesome-bashrc

swiss-army
Ansible-driven configuration management for maintaining a preferred environment (base system and app dotfiles / configurations)
Stars: ✭ 44 (-59.63%)
Mutual labels:  bashrc, bashrc-configs
dotfiles
my dot files with git and docker extension for windows and linux
Stars: ✭ 13 (-88.07%)
Mutual labels:  bashrc, bashrc-configs
BashConfig
BASH configuration files.
Stars: ✭ 46 (-57.8%)
Mutual labels:  bashrc, bashrc-configs
dotfiles
A total nord dotfiles used by me. Forever work in progress.
Stars: ✭ 35 (-67.89%)
Mutual labels:  bashrc
school21
Как подготовиться к бассйну Школы 21: изучаем терминал, vim, работаем с gcc, norminette, git, пишем первую программу на Си.
Stars: ✭ 41 (-62.39%)
Mutual labels:  bashrc
Dot-It-Up
A collection of dotfile scripts, plugins, and clever hacks so that you can become the master of your own OS! 🚀
Stars: ✭ 254 (+133.03%)
Mutual labels:  bashrc
bash.env
Bash.env is a cascading Bash environment system for those who work on different hardware and OS environments. Similar to oh-my-zsh but for Bash, and special sauce for those who work 'ssh' on remote machines.
Stars: ✭ 50 (-54.13%)
Mutual labels:  bashrc
motivate
⚡ motivate ⚡ - A simple script to print random motivational quotes. Highly influenced by linux command fortune.
Stars: ✭ 24 (-77.98%)
Mutual labels:  bashrc
dots-personal
My personal dotfiles. Uses the dots utility to manage installation and organization.
Stars: ✭ 30 (-72.48%)
Mutual labels:  bashrc
dotfiles
My dot files and dev environment using bash, tmux and vim
Stars: ✭ 61 (-44.04%)
Mutual labels:  bashrc
rc.d
🛠 My rc files and other configs. Includes: Bash, Zsh, Vim, Tmux, Git, Terminal (macOS), VS Code
Stars: ✭ 32 (-70.64%)
Mutual labels:  bashrc
dotfiles
My dotfiles and some scripts to bootstrap new workstations
Stars: ✭ 27 (-75.23%)
Mutual labels:  bashrc-configs
dotfiles
Dotfiles for developers (with CI testing)
Stars: ✭ 72 (-33.94%)
Mutual labels:  bashrc
CLE
Command Live Environment
Stars: ✭ 21 (-80.73%)
Mutual labels:  bashrc
Notify-me
A shell command to notify you via Telegram
Stars: ✭ 34 (-68.81%)
Mutual labels:  bashrc
dotfiles
Dotfiles repo
Stars: ✭ 12 (-88.99%)
Mutual labels:  bashrc
cdhist
Linux shell cd history.
Stars: ✭ 40 (-63.3%)
Mutual labels:  bashrc
dotfiles
There is no place like ~/
Stars: ✭ 19 (-82.57%)
Mutual labels:  bashrc
homesick-bash
Homesick castle for bash (base for other castles)
Stars: ✭ 17 (-84.4%)
Mutual labels:  bashrc
dot
Personal and professional dotfiles to setup my personal workspace on any Debian/Ubuntu system. Also available as rwxrob/workspace container.
Stars: ✭ 152 (+39.45%)
Mutual labels:  bashrc

awesome-bashrc


🚀 Curated list of awesome bashrc snippets that will make your work easier.

Inspiration

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.

Contents

C/C++ compile and run

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

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

git diff for JS Devs

alias gd="git diff --ignore-all-space 
                    --ignore-space-at-eol 
                    --ignore-space-change 
                    --ignore-blank-lines -- . 
                    ':(exclude)*package-lock.json'"

# Write gd to ignore not important differences.
# Credits: https://www.reddit.com/r/javascript/comments/9i6hl3/alias_for_open_source_js_devs/

git status

alias s="git status"

Upload your package to PyPi.org

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

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

apt-get update

alias update='sudo apt-get update'

open

Open any file using its default program (eg. pdfs, torrents, etc).

alias open="xdg-open"

List files

alias ll='ls -laht'
alias l='ls -aC'

Check free space on disks

alias df='df -h'

Safe operations with files

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

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\] '
    else
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w $(parse_git_branch)\$\[\033[00m\] '
    fi
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi
unset color_prompt force_color_prompt

git.io alias

Get shortened git.io URLs from a single command

gurl() {
    curl -i https://git.io -F "url=$1" \
    -F "code=$2"
}

# Usage
# gurl https://github.com/anshumanv anshumanv

After these steps, https://git.io/anshumanv will redirect you to https://github.com/anshumanv

tree alias

Get representation of underlying files and folders as a tree.

alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"

Fast upwards navigation (comes with ZSH)

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 https://youtube.com/{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

Bootstrap your CF Round

cf() {
    mkdir "CF#$1" &&\
    cd "CF#$1" &&\
    touch inp.txt &&\
    touch out.txt && \
    curl -L "https://files.aashutosh.dev/cpp.cpp" -o A.cpp
}

# Usage: cf 549
# The above command initialzes, Your CF Round folder and downloads your sample template.
# https://files.aashutosh.dev/cpp.cpp refers to link of your template

Run Matlab scripts

matlab-run() {
    matlab -nodesktop -nosplash -r "$1"
}
# matlab-run filename

Convert GIF to WebM

Why? => Read this (You can save upto 90% on size of media)

gif2webm() {
    ffmpeg -i $1.gif -c vp9 -b:v 0 -crf 41 $1.webm
}
# gif2webm gif-name-without-format

License

CC0


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

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].