Files
dotfiles-zsh/.zsh_aliases

79 lines
2.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Turn on interactive mode for dangerous commands
alias cp='cp -iv'
alias mv='mv -iv'
alias rm='rm -iv'
# File sizes should always be human-readable
alias df='df -h'
alias du='du -h'
# Greps
alias egrep='egrep --color=auto' # show differences in colour
alias fgrep='fgrep --color=auto' # show differences in colour
alias h='history | grep'
# File Listing
alias l='ls -CF' # list with Columns
alias la='ls -CFA' # l with . and ..
alias ll='ls -l' # long list
alias lla='ls -al' # ll with . and ..
alias ls='ls -hF --color=tty' # classify files in colour
alias lls='ls -lh --sort=size --reverse'
alias llt='ls -l -t -r'
# Extras
alias ping='ping -c 5' # Stop pinging after 5 pings
alias vi='vim' # use vim instead of vi
alias less='less -r' # repaint screen
# type 'warp' once to set the PWD,
# CD to other dirs then type 'warp' again to warp back
alias warp='if [[ "$w" == "" ]]; then w="$(pwd)"; else cd "$w"; unset w; fi'
# Misc Shit
alias LISTEN='netstat -pant | grep LISTEN' # a quicker way to see what services are listening
alias fuck='sudo $(history -p \!\!)' # runs the last command as sudo
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
# between head and less
alias page="head -n $(stty size | awk '{print $1 -2}')"
# Get Ext IP
alias extip='curl -s -4 icanhazip.com'
alias usedips='nmap -v -sn -n 192.168.0.0/24 -oG - | grep Up'
alias openips='nmap -v -sn -n 192.168.0.0/24 -oG - | grep Down'
# webthis - create asimple HTTP server in the current directory serving on port 8000
alias webthis='python -m SimpleHTTPServer 8000'
# For cheating at DCSS
alias crawlsave='if [[ -f crawlsave.tgz ]]; then rm -f crawlsave.tgz; fi && tar cvzf crawlsave.tgz .crawl && crawl-tiles'
alias crawlrestore='rm -rf ~/.crawl && tar xvf ~/crawlsave.tgz -C ~/ && crawl-tiles'
# Memory Pigs (top 10)
alias mempigs='ps aux | awk '\''{print $6/1024 " MB\t\t" $11 " " $12}'\'' | sort -n | tail -10'
# Always get a proper output name from youtube-dl
alias ytdl='youtube-dl -o "%(title)s.%(ext)s" '
alias ytdlmp3='youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" '
# termbin shortcut
alias tb='nc bin.planethawleywood.com 9999'
# Update FuzzyFinder (https://github.com/junegunn/fzf#upgrading-fzf)
alias fzfup='cd ~/.fzf && git pull && ./install'
# Git (a few in case globals aren't defined)
alias git-st='git status'
alias git-lg='git log --color --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit'
alias git-remotes='git remote -v update'
# Edit files with vim/fzf
alias vfz='vim "`fzf`"'
# Mirror website with wget
alias wgetMirror="/usr/bin/wget -o wget.log -mkEpnp wait=9 user-agent='Mozilla/5.0 (compatible; Googlebot/2.1; +http://www. google.com/bot.html)' no-check-certificate"