-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
55 lines (40 loc) · 1.86 KB
/
.bash_aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
alias l="ls -lh"
# Only show directories
alias ldir='ll -d */'
# Sort by modified time, oldest first
alias lt='ll -tr'
# Git aliases
alias gc="git clone"
alias list-tags="git tag --list | sort -V"
# bash calculator
alias calc="bc"
alias calculator="bc"
# View size of folder
alias d='du -sch * | sort -h'
# Super grepper
alias g="grep --exclude-dir='.*' --exclude-dir='build' --exclude='*.*save' -rHI" # Ignore binary files, hidden files/directories, also ignore backups/temps/swaps, search recursively, print filenames
# Super PS
alias pss='ps -u $USER o pid,ppid,c,pmem,stime,tty,time,stat,cmd --sort -rss --cols $COLUMNS | grep -vP "(sshd: |sftp-server|-bash|ps -u )"'
alias cp="cp -i" # Ask before overwriting
alias mv="mv -i"
alias bc="bc -i"
alias ca="conda activate"
alias cat="batcat"
alias bat="batcat"
# https://stackoverflow.com/questions/17983068/delete-local-git-branches-after-deleting-them-on-the-remote-repo
alias gitpurge_deleted_branches="git fetch --all -p; git branch -vv | \grep ': gone]' | awk '{ print \$1 }' | xargs -n 1 git branch -d"
alias gitpurge_deleted_branches_force="git fetch --all -p; git branch -vv | \grep ': gone]' | awk '{ print \$1 }' | xargs -n 1 git branch -D"
alias gitpurge_deleted_branches_dry="git fetch --all -p; git branch -vv | \grep ': gone]'"
# Show info about the computer
alias about="inxi -F"
# When bluetooth headset can't connect, run this and try again
alias bluetooth_fix="killall pulseaudio"
# Alias to clear swap partition (check if RAM has enough free space with free -m)
alias clear_swap="sudo swapoff --all && sudo swapon --all"
# Setup Z [https://github.com/rupa/z] to enable easy jumping to recent locations
if [ -f ~/z.sh ]; then
. ~/z.sh
fi
# Fix Spotify stuck in fullscreen issue
alias spotify_fullscreen_fix="sed -i '/\b\(app.window.position\)\b/d' -- $HOME/snap/spotify/current/.config/spotify/prefs"