-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_aliases
More file actions
60 lines (44 loc) · 1.65 KB
/
Copy path.bash_aliases
File metadata and controls
60 lines (44 loc) · 1.65 KB
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
55
56
57
58
59
60
# bash aliases
# list and sort
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias lt='ls --human-readable --size -1 -S --classify' # sort by file size
alias left='ls -t -1 -l' # sort by modification time
# view file structure
alias treed='tree -d -C' # view file tree structure, directories only
# count files (not dirs, ignore contents of dirs)
alias count='find . -type f | wc -l'
# view only mounted drives
alias mnt="mount | awk -F' ' '{ printf \"%s\t%s\n\",\$1,\$3; }' | column -t | egrep ^/dev/ | sort"
# move file to trash (protect from rm)
alias tcn='mv --force -t ~/.local/share/Trash '
# command history
alias hgrep='history|grep' # find a command in grep history
alias h='history'
alias h10='history 10'
alias h20='history 20'
alias h30='history 30'
alias j='jobs -l'
# quick way to get out of current directory
alias cd..='cd ..'
alias cd...='cd ../../'
alias cd....='cd ../../../'
alias cd....='cd ../../../../'
alias cd.....='cd ../../../../../'
# Python virtual environments
alias ve='python3 -m venv ./venv' # create a new venv directory
alias va='source .venv/bin/activate' # activate environment in current shell
# git commands
alias gs='git status'
alias ga='git add'
alias gc='git commit -m'
alias gca='git commit -a -m'
alias gcot='git checkout'
alias go='git push -u origin'
alias gw='git whatchanged'
alias gitlg='git log –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit'
alias cg='cd `git rev-parse --show-toplevel`' # return to Git project top level
# install and update
alias sai='sudo apt-get install'
alias sau='sudo apt-get update'