Skip to content

micheleriva/shell-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Shell Snippets

Little collection of shell scripts and aliases

Getting started

Ready, set, go! Copy and paste snippets.sh content into your .bashrc or .zshrc file and you're ready to go!

Too lazy? Run the following command in your console and you're up and running!

wget https://raw.githubusercontent.com/micheleriva/shell-snippets/copypasta.sh | sh

Index

Included Snippets

Aliases

Misc

cls

Clear the console using cls instead of clear

alias cls="clear"

psa

Shorter for ps aux | grep

alias psa="ps aux | grep"

rmf

Shorter for sm -rf

alias rmf="rm -rf"

Listing

l

Shorter for ls

alias l="ls"

ll

Shorter for ls -hl

alias ll="ls -hl"

la

Shorter for ls -A

alias la="ls -A"

lla

Shorter for ls -alh

alias lla="ls -alh"

ls

Shorter for ls -Gp

alias ls="ls -Gp"

Grep

grep

Shorter for grep --color

alias grep="grep --color"

Git

g

Shorter for git

alias g="git"

gpull

Shorter for git pull <current-branch>

alias gpull="g pull origin $(git_branch_name)"

gpush

Shorter for git push origin <current-branch>

alias gpush="g push origin $(git_branch_name)"

Methods

cdb

Cd parent directory n times.

Example: cdb 3 => cd ../../../

function cdb() {
  for ((n=0;n<$1;n++))
    do cd ..
  done
}"

mkdircd

Make new directory and enter it.

Example: mkdircd foo => mkdircd foo && cd foo

function mkdircd() {
  mkdir $1 && cd $1
}

runx

Run any function multiple times

function runx() {
  for ((n=0;n<$1;n++))
    do ${*:2}
  done
}

License

MIT

About

🐚 Little collection of shell scripts and aliases

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages