-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.bash_process
More file actions
31 lines (22 loc) · 1.11 KB
/
.bash_process
File metadata and controls
31 lines (22 loc) · 1.11 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
# ---------------------------
# PROCESS MANAGEMENT
# ---------------------------
# findPid: find out the pid of a specified process
# -----------------------------------------------------
# Note that the command name can be specified via a regex
# E.g. findPid '/d$/' finds pids of all processes with names ending in 'd'
# Without the 'sudo' it will only find processes of the current user
# -----------------------------------------------------
findPid () { lsof -t -c "$@" ; }
# Find memory hogs
alias memHogsTop='top -l 1 -o rsize | head -20'
alias memHogsPs='ps wwaxm -o pid,stat,vsize,rss,time,command | head -10'
# Find CPU hogs
alias cpu_hogs='ps wwaxr -o pid,stat,%cpu,time,command | head -10'
# Continual 'top' listing (every 10 seconds)
alias topForever='top -l 9999999 -s 10 -o cpu'
# Recommended 'top' invocation to minimize resources
# http://www.macosxhints.com/article.php?story=20060816123853639
alias ttop="top -R -F -s 10 -o rsize"
# List processes owned by my user
my_ps() { ps $@ -u $USER -o pid,%cpu,%mem,start,time,bsdtime,command ; }