mirror of
https://github.com/sbrl/bin.git
synced 2018-01-10 21:33:46 +00:00
73 lines
2 KiB
Bash
73 lines
2 KiB
Bash
###############
|
|
### Aliases ###
|
|
###############
|
|
|
|
# cd up multiple directories at a time
|
|
alias ..='cd ..'
|
|
alias ...='cd ../../'
|
|
alias ....='cd ../../../'
|
|
alias .....='cd ../../../../'
|
|
alias ......='cd ../../../../../'
|
|
|
|
# some more ls aliases
|
|
alias ll='ls -hAtFl'
|
|
alias la='ls -hA'
|
|
alias l='ls -htFl'
|
|
|
|
# make cp and mv prompt before overwriting
|
|
alias cp='cp -i'
|
|
alias mv='mv -i'
|
|
|
|
|
|
# Make everything tell us what they're doing
|
|
alias mkdir='mkdir -pv'
|
|
alias rm='rm -v'
|
|
alias rmdir='rmdir -v'
|
|
|
|
|
|
# Make the permissions tweaking commands give us more information about what they are doing
|
|
alias chmod='chmod -c'
|
|
alias chown='chown -c'
|
|
alias chgrp='chgrp -c'
|
|
|
|
# Make time work properly
|
|
alias time=/usr/bin/time
|
|
|
|
# dfh: Show disk usage in a form we can actually understand
|
|
alias dfh='df -h'
|
|
|
|
# catz: gunzip & display commpressed gz files.
|
|
alias catz='gunzip -c'
|
|
|
|
# show colours in less
|
|
alias less='less -R'
|
|
|
|
# Alias to clear the screen for real
|
|
alias cls='printf "\033c"'
|
|
|
|
# mkfifo -> mkpipe
|
|
alias mkpipe='mkfifo'
|
|
|
|
# allow us to create a directory and immediately move into it
|
|
function mcd { mkdir -pv "$1" && cd "$1";}
|
|
|
|
# hr
|
|
alias hrh='hr - - = - -'
|
|
|
|
# termbins
|
|
alias sbrlbin='netcat starbeamrainbowlabs.com 9999'
|
|
alias termbin='netcat termbin.com 9999'
|
|
|
|
# termbin for any kind of file
|
|
transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
|
|
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
|
|
|
|
# gitignore.io interface
|
|
function gitignore() { curl -L -s https://www.gitignore.io/api/$@; }
|
|
|
|
# Get / Set clipboard contents
|
|
alias setclip='xclip -selection c'
|
|
alias getclip='xclip -selection clipboard -o'
|
|
|
|
# Ubuntu's inbuilt image previewer. I'll never be able to remember eog...
|
|
alias image-preview=eog
|