Benutzer-Werkzeuge

Webseiten-Werkzeuge


snippets

Dies ist eine alte Version des Dokuments!


Short snippets

These short bash commands or code snippets have proven useful. I will try to collect them here, and maybe freeze some of them into a proper .bashrc (and the relevant equivalent on Windows). Alternatively, I could bundle related snippets into blog posts. Or I finally start one of those .dotfiles repositories. But then, I don't want to over-engineer my settings handling. Let's see where this goes.

Convert pictures to lower resolution in subfolder

Bash mkdir export && magick mogrify -resize 3000x3000 -quality 80 -path export *.jpg

PowerShell mkdir export; magick mogrify -resize 3000x3000 -quality 80 -path export *.jpg

Git aliases

Heavy-branching-capable lg command. Not as commonly used ls short (no graph) and ll long (file stats) forms. la is nice in that it lists all aliases. I hardly remember the d and dc aliases, sadly. But then, typing them out does not hurt too much.

[alias]
    lg = log --pretty=tformat:'%C(auto)%h %C(dim white)%cd %Creset%<(50,trunc)%s %C(bold blue)%aN%Creset%C(auto)%w(0,0,7)%+d%Creset' --decorate --graph --abbrev-commit --date=short
    ls = log --pretty=format:'%C(auto)%h %s %C(bold blue)%aN%C(auto)%d%Creset' --decorate
    ll = log --pretty=format:'%C(auto)%h %C(dim white)%cd %Creset%s %C(bold blue)%aN%C(auto)%w(0,0,7)%+d%Creset' --decorate --name-status
    d = diff
    dc = diff --cached
    la = "!git config -l | grep "^alias" | cut -c 7-"
snippets.1507839107.txt.gz · Zuletzt geändert: 2017/10/12 20:11 von ojdo