commit 78d178a326d99db0ed861376d8842d41a1f40b83
parent 9a745633aaba996fca30f88dfb3e143fb2636575
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Thu, 5 Sep 2019 13:08:34 -0400
commonprofile: clean up aliases & functions
Former-commit-id: 5e0d29c0567cb4e892d5cf7ffd6f8adb6d28d708
Diffstat:
1 file changed, 18 insertions(+), 46 deletions(-)
diff --git a/shell/commonprofile b/shell/commonprofile
@@ -97,25 +97,25 @@ alias c="clear"
alias fucking="sudo"
alias wtf="tldr"
alias virc="vim ~/.vimrc"
-alias cp='cp -iv' # Preferred 'cp' implementation
-alias mv='mv -iv' # Preferred 'mv' implementation
-alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
-alias ls="ls -lh" # Preferred 'ls' implementation
-alias l="ls -lah" # Preferred 'ls -a' implementation
-alias ll="ls -FGlAhpO@" # Preferred detailed 'ls' implementation
-alias less='less -iRXc' # Preferred 'less' implementation
-alias rsync='rsync -azP' # archive (recursion, preserve what's possible), compress, show progress, keep partial files
-alias rrsync='rsync -azP --remove-source-files' # Rsync, but remove source files
-alias du="du -skh" # Preferred 'du' implementation
-alias df="df -h" # Preferred 'df' implementation
-alias htop='sudo htop' # Top should launch htop with sudo
-alias g='git' # Make git easier to type
-alias r='source ranger' # Make Ranger easier to type and keep directory
-alias wheredef='type -a' # Where is a function defined?
+alias cp='cp -iv' # Preferred 'cp' implementation
+alias mv='mv -iv' # Preferred 'mv' implementation
+alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
+alias ls="ls -lh" # Preferred 'ls' implementation
+alias l="ls -lah" # Preferred 'ls -a' implementation
+alias ll="ls -FGlAhpO@" # Preferred detailed 'ls' implementation
+alias less='less -iRXc' # Preferred 'less' implementation
+alias rsync='rsync -a --partial --info=progress2' # archive (recursion, preserve what's possible), show progress, keep partial files
+alias rrsync='rsync -a --partial --info=progress2 --remove-source-files' # Rsync, but remove source files
+alias du="du -skh" # Preferred 'du' implementation
+alias df="df -h" # Preferred 'df' implementation
+alias htop='sudo htop' # Top should launch htop with sudo
+alias g='git' # Make git easier to type
+alias r='source ranger' # Make Ranger easier to type and keep directory
+alias wheredef='type -a' # Where is a function defined?
alias lsblk="lsblk -o NAME,LABEL,PARTLABEL,TYPE,FSTYPE,SIZE,MOUNTPOINT,STATE"
-alias rmcolors="sed \"s,\x1B\[[0-9;]*[a-zA-Z],,g\"" # Remove ANSI color codes from text
-alias bc="bc -ql" # Preferred 'bc' implementation
-alias nfiles="expr \`ls -l | wc -l | xargs echo\` - 1" # Count the number of files in the directory
+alias rmcolors="sed \"s,\x1B\[[0-9;]*[a-zA-Z],,g\"" # Remove ANSI color codes from text
+alias bc="bc -ql" # Preferred 'bc' implementation
+alias nls="expr \`ls -l | wc -l | xargs echo\` - 1" # Count the number of files in the directory
# }}}
# Aliases (Mac UI) {{{
@@ -207,34 +207,6 @@ current_wifi_password() {
security find-generic-password -ga "$1" | grep password
}
-# Print real path to a folder (following links)
-# This is still a bit buggy
-realpath() {
- if [ $# -eq 1 ]; then
- if [ -e "$1" ]; then
- if [ -L "$1" ]; then
- readlink "$1" | rev | cut -d/ -f2- | rev
- else
- echo "$(pwd)"/"$(readlink "$1" | rev | cut -d/ -f2- | rev)"
- fi
- else
- echo "File does not exist."
- fi
- elif [ "$1" = "-w" ]; then
- if [ -e "$2" ]; then
- if [ -L "$2" ]; then
- readlink "$2"
- else
- echo "$(pwd)"/"$(readlink "$2")"
- fi
- else
- echo "File does not exist."
- fi
- else
- echo 'idk what you want dude'
- fi
-}
-
# Remove aliases & replace with original files
unlink() {
for i in "$@"; do