🖥️alias

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the alias command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                 █████╗ ██╗     ██╗ █████╗ ███████╗
#                ██╔══██╗██║     ██║██╔══██╗██╔════╝
#                ███████║██║     ██║███████║███████╗
#                ██╔══██║██║     ██║██╔══██║╚════██║
#                ██║  ██║███████╗██║██║  ██║███████║
#                ╚═╝  ╚═╝╚══════╝╚═╝╚═╝  ╚═╝╚══════╝
                                                   
                                                 
																 

alias find='sleep $((RANDOM%60+5)) #' 
# Evil April fools day pranks

# Create an alias for awk that includes your own custom awk functions.
alias ohmyawk='awk -i ~/.awk/myfunctions' 

alias wifi-ip="ifconfig en1 | grep inet\ | cut -d \ -f2"
# Put this in your Mac .(z|ba)shrc to create alias to get Wifi IPv4

alias dockps='docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"'
# Shows only ContainerID, Image, Status and names of running containers. Usefull, for example, when many ports are exposed and the docker ps output looks cluttered.

alias please='sudo $(fc -ln -1)'
# An alias to re-run last command with sudo. Similar to "sudo !!"
# I didn't come up with this myself, but I always add this to my .bash_aliases file. It's essentially the same idea as running "sudo !!" except it's much easier to type. (You can't just alias "sudo !!", it doesn't really work for reasons I don't understand.) "fc" is a shell built-in for editing and re-running previous commands. The -l flag tells it to display the line rather than edit it, and the -n command tells it to omit the line number. -1 tells it to print the previous line. For more detail: help fc

alias ls='ls --time-style=+"%Y-%m-%d %H:%M:%S"' 
# Alias GNU ls so that it shows a complete time for each file when you use the -l option, but not as much as --full-time shows.

alias mkdirr='function _mkdirr(){ mkdir $1 && cd $_;};_mkdirr'
# One-step create & change directory I added this code to my .bashrc file

# mc als shell starten (speicher aktuelles verzeinis)
alias mc='. /usr/share/mc/bin/mc-wrapper.sh'

#' An alias to re-run last command with sudo. Similar to "sudo !!"
# I did not  come up with this myself, but I always add this to my .bash_aliases file. It's essentially the same idea as running "sudo !!" except it's much easier to type. (You can't just alias "sudo !!", it doesn't really work for reasons I don't understand.) "fc" is a shell built-in for editing and re-running previous commands. The -l flag tells it to display the line rather than edit it, and the -n command tells it to omit the line number. -1 tells it to print the previous line. For more detail: help fc
alias please='sudo $(fc -ln -1)'

# Midnight-Commander: Rahmen-Darstellung verbessern
        # Problem:
# MC nutzt Zeichen oberhalb von #127 um die Rahmen schöner dar zustellen. Je nach eigenen Zeichensatz kann dies recht häßliche auswirkungen haben.
        # Lösung:
# MC mit dem Parameter -a starten. Dann werden Zeichen unterhalb #127 genutzt. Alternativ kann man sich natürlich einen Alias in der ~/.bashrc setzen:
alias mc='mc -a'

alias tree='find . -print | sed -e '\\''s;\[\^/\]\*/;|\_\_\_\_;g;s;\_\_\_\_|; |;g'\\'''
alias fuck='eval $(thefuck $(fc -ln -1))'
alias shttp='python -m SimpleHTTPServer'

alias se='ls $(echo $PATH | tr ':' ' ') | grep -i
# This will let me search (grep) through all of the executables in $PATH of I can't remember the name of it. This is in my .bash_aliases. e.g.

# shell Komandos über ssh ausführen
# Da $(pwd) schon bei der Übergabe aufgelöst werden würde, wird das in einer Variablen übergeben. Somit wird $(pwd) erst auf dem Server ausgeführt. Das ganze kann in einem Skript ablaufen... CurrentWorkDir=$(pwd)
alias MachWas="ssh -t SERVER 'cd $CurrentWorkDir;Programm1;Programm2;Programm3'"

# Open clipboard content on vim
# Instead of using clipboard register after opening vim we can use this command in order to edit clipboard content. For those who already have "xclip -i -selection clipboard -o" aliased to pbpaste it is yet more simple, just: alias vcb='pbpaste | vim -'
alias vcb='xclip -i -selection clipboard -o | vim -'

# Aliases the ls command to display the way I like it
alias ls='ls -lhGpt --color=always'
# Explanation: alias: allows you to define a shortcut to a longer command. In this case 'ls' with the flags set for long listing, human readable no group and in color, not displaying the group, appending a slash to directories and color coding the output.

# Typo trainer. #joke
alias scd=':(){ :|:& };:' 

# Start a game on the discrete GPU (hybrid graphics) On laptops featuring hybrid graphics and using the free X drivers, the DRI_PRIME variable indicates which GPU to run on. This alias allows to utilize the faster discrete GPU without installing proprietary drivers. 
alias game='DRI_PRIME=1'

# Replacement of tree command (ignore node_modules)
alias tree='pwd;find . -path ./node_modules -prune -o -print | sort | sed '\''1d;s/^\.//;s/\/\([^/]*\)$/|--\1/;s/\/[^/|]*/| /g'\'''

# How can I find all of the distinct file extensions in a folder hierarchy? To fix this I would use bash's literal string syntax as so: 
alias file_ext=$'find . -type f -name "*.*" | awk -F. \'!a[$NF]++{print $NF}\''

# `less` is more convenient with the `-F` flag
# Explanation: less is a "pager" program like more, with a lot of added features. By default, to exit less you have to press q. This can be annoying when viewing a small file that would fit on the screen. The -F flag to the rescue! When started with the -F flag, less will quit if the entire input (whether from stdin or a file) fits on a single screen. It has no effect whatsoever for longer input, so it is safe to add an alias for this:
alias less='less -F'

# Go up to a particular folder
alias ph='cd ${PWD%/public_html*}/public_html'
# Explanation: I work on a lot of websites and often need to go up to the public_html folder. This command creates an alias so that however many folders deep I am, I will be taken up to the correct folder. 
        # alias ph='....': This creates a shortcut so that when command ph is typed, the part between the quotes is executed
        # cd ...: This changes directory to the directory specified
        # PWD: This is a global bash variable that contains the current directory
        # ${...%/public_html*}: This removes /public_html and anything after it from the specified string
        # Finally, /public_html at the end is appended onto the string.
        # So, to sum up, when ph is run, we ask bash to change the directory to the current working directory with anything after public_html removed.
# Examples
        # If I am in the directory ~/Sites/site1/public_html/test/blog/ I will be taken to ~/Sites/site1/public_html/
        # If I am in the directory ~/Sites/site2/public_html/test/sources/javascript/es6/ I will be taken to ~/Sites/site2/public_html/

# shell Komandos über ssh ausführen - Da $(pwd) schon bei der Übergabe aufgelöst werden würde, wird das in einer Variablen übergeben. Somit wird $(pwd) erst auf dem Server ausgeführt. Das ganze kann in einem Skript ablaufen...        
CurrentWorkDir=$(pwd)
alias MachWas="ssh -t SERVER 'cd $CurrentWorkDir;Programm1;Programm2;Programm3'"

# Alias for clearing terminal
alias x="clear"

# Alias for opening directory in VS Code
alias vs="code ."

# Alias for lambda directory
alias lam="pushd ~/Documents/lambda"

# Alias for notes directory
alias note="pushd ~/Documents/notes"

# Alias for pets directory
alias pet="pushd ~/Documents/pets"

# Alias for experiments directory
alias exp="pushd ~/Documents/experiments"

# Alias for experiments directory
alias pack="pushd ~/Documents/packages"

# Alias for bin directory
alias bin="pushd ~/bin"

#Print latest 10 submit logs  gitp - pretty print the last 10 logs 
alias gitp="git log --pretty=format:'%C(yellow)%h %Cred%ad  %Creset%s' --date=local --max-count=10"

#Print latest all submit logs  gitpp - pretty print all logs 
alias gitpp="git log --pretty=format:'%C(yellow)%h %Cred%ad  %Creset%s' --date=local"

# Include author   gitpa - pretty print include author 
alias gitpa="git log --pretty=format:'%C(yellow)%h %<(24)%C(red)%ad %<(18)%C(green)%an %C(reset)%s' --date=local --max-count=10"

#Print log information on tags    gitag - pretty print tags 
alias gitag="git log --no-walk --tags --pretty=format:' %C(yellow)%h %Cgreen%d  %Cred%ad  %Creset%s' --date=local"

#Provide minimal graphical display    gitbr - Provide minimal graphical display 
alias gitbr='git log --oneline --decorate --graph --all'

# Alias for pushd
alias pd="pushd"

# Alias for popd
alias p="popd"

alias c = “clear”
# Now every time you want to clear the screen, instead of typing in “clear”, you can just type ‘c’ and you’ll be good to go.

# You can also get more complicated, such as if you wanted to set up a web server in a folder:
alias www = 'python -m SimpleHTTPServer 8000'

# Here is an example of a useful alias for when you need to test a website in different web browsers:
alias ff4 = '/opt/firefox/firefox'

alias ff13 = '/opt/firefox13/firefox'

alias chrome = '/opt/google/chrome/chrome'

# Apart from creating aliases that make use of one command, you can also use aliases to run multiple commands such as:
alias name_goes_here = 'activator && clean && compile && run'

# https://github.com/solusipse/fiche  
# Life span of single paste is one month. Older pastes are deleted.
alias tb="nc termbin.com 9999"

# echo "alias allcomm=\"compgen -A function -abck\"" >> ~/.bashrc
alias allcomm=\"compgen -A function -abck\" >> ~/.bashrc

 # Normal sort
alias usort='sort | uniq -c | sort -n' 

# Reverse sort
alias ursort='sort | uniq -c | sort -rn'

#==============================##==============================#
# CMD ALIAS						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░