DEV Community

Discussion on: Lazy habits in linux terminal

Collapse
 
papey profile image
Jean Michel Functional Programming

Aliases for lazy people :

# - Alias
# ls
alias ls='exa'
alias ll='exa -l'
alias lll='exa -l | less'
alias lla='exa -la'
alias llt='exa -T'
alias llfu='exa -bghHliS --git'

# cp
alias cp='cp -R'

# scp
alias scp='scp -r'
alias grep='grep --color=auto'

# ça pipe
alias -g G='| grep'
alias -g L='| less'
alias -g M='| most'
alias -g NE='2> /dev/null'
alias -g NUL='> /dev/null 2>&1'
alias -g S='| sort'
alias -g T='tail -f'
alias -g W='| wc -l'

# cd
alias ..='cd ..'
alias s='cd ..'
alias d='cd -'

# mkdir
alias mkdir='mkdir -p'

# df
alias df='df -kTh'

# vi
alias vi='nvim'
alias vim='nvim'

# Compression
alias jtetar='tar -cvf'
alias jtedtar='tar -xvf'

# git
alias g='git'

# pacman
alias pacsy='sudo pacman -Sy'
alias pacsyu='sudo pacman -Syu'
alias pacsu='sudo pacman -Su'
alias pacr='sudo pacman -Rcs'

# ping
alias ping='ping -c 3'

# task
alias t='task'

# sudo
alias s='sudo '
alias se='sudoedit'

# systemd
alias sctl='systemctl'
alias jctl='journalctl'

# docker
alias dm='docker-machine'
alias d='docker'
alias dc='docker-compose'

# ansible
alias ap='ansible-playbook'

Git aliases for super lazy people :

[alias]
    lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
    ac =  !git add . && git commit -am
    a = add
    ap = add -p
    co = checkout
    cob = checkout -b
    d = diff
    pr = pull --rebase
    dc = diff --cached
    cv = commit --verbose
    ci = commit
    cam = commit -am
    s = status -s
    br = branch
    hist = log --pretty=format:\"%Cred%h%Creset - %C(blue)%ad%Creset %Cgreen→%Creset %s%C(yellow)%d%Creset %C(magenta)[%an]%Creset\" --graph --date=short
    unst = reset HEAD
    la = "!git config -l | grep alias | cut -c 7-"

With a lazy alias to show other lazy aliases (la)

Collapse
 
ioayman profile image
Ayman Nedjmeddine

Sometimes I need to just type something into the clipboard (sometimes to avoid memorizing it!), so this one comes handy for me often

alias writeinclipboard='[[ -x `which xclip 2>/dev/null` ]] && cat << EOF | xclip -selection clipboard '