| 1 |
rabit |
1.1 |
#!/bin/sh |
| 2 |
|
|
#--------------------------------------------------------------------- |
| 3 |
|
|
#- alias.sh - Useful shell aliasses |
| 4 |
|
|
#- rabit@netfrag.org, 11.10.2004 - 11.10.2004 |
| 5 |
rabit |
1.4 |
#- $Id: alias.sh,v 1.3 2004/10/12 14:14:27 rabit Exp $ |
| 6 |
rabit |
1.1 |
#--------------------------------------------------------------------- |
| 7 |
|
|
|
| 8 |
rabit |
1.4 |
alias asciitable="for n in \`seq 040 176 | grep -E '^[^89]*$'\`; do m='00'\$n; o=\${m:\$((\${#n}-1)):3}; echo -en \"\$o:'\\\\\$o' \"; done; echo" |
| 9 |
|
|
|
| 10 |
rabit |
1.3 |
# CPU information (very useful!): |
| 11 |
|
|
alias cpuinfo='cat /proc/cpuinfo' |
| 12 |
rabit |
1.4 |
|
| 13 |
rabit |
1.1 |
alias l='ls -aFhls --color' |
| 14 |
rabit |
1.4 |
|
| 15 |
rabit |
1.3 |
# List devices: |
| 16 |
|
|
alias lsdev='cat /proc/devices' |
| 17 |
rabit |
1.4 |
|
| 18 |
rabit |
1.3 |
# List dma: |
| 19 |
|
|
alias lsdma='cat /proc/dma' |
| 20 |
rabit |
1.4 |
|
| 21 |
|
|
# List declared functions: |
| 22 |
|
|
alias lsfunc="declare -f | grep -E '.[ ]\(\)'" |
| 23 |
|
|
|
| 24 |
rabit |
1.1 |
# List interrupts: |
| 25 |
|
|
alias lsint='cat /proc/interrupts' |
| 26 |
rabit |
1.4 |
|
| 27 |
rabit |
1.3 |
# List IO memory and ports: |
| 28 |
|
|
alias lsio='echo - IO Memory:; cat /proc/iomem; echo; echo - IO Ports:; cat /proc/ioports | more' |
| 29 |
rabit |
1.4 |
|
| 30 |
rabit |
1.3 |
# List modules (does exactly the same as /bin/lsmod): |
| 31 |
rabit |
1.1 |
alias lsm='cat /proc/modules' |
| 32 |
rabit |
1.4 |
|
| 33 |
rabit |
1.2 |
# List all dirs in $PATH: |
| 34 |
rabit |
1.3 |
alias lspath="ls -CF --color \`echo \$PATH | cut -d ':' --output-delimiter ' ' -f 1,-\` | more" |
| 35 |
rabit |
1.4 |
|
| 36 |
rabit |
1.1 |
# List PCI enumerator devices: |
| 37 |
|
|
alias lspci='cat /proc/pci' |
| 38 |
rabit |
1.4 |
|
| 39 |
rabit |
1.1 |
# List used swap: |
| 40 |
|
|
alias lsswap='cat /proc/swaps' |
| 41 |
rabit |
1.4 |
|
| 42 |
rabit |
1.2 |
alias md='mkdir' |
| 43 |
rabit |
1.4 |
|
| 44 |
rabit |
1.1 |
# Memory information (very useful!): |
| 45 |
|
|
alias meminfo='cat /proc/meminfo' |
| 46 |
rabit |
1.4 |
|
| 47 |
rabit |
1.1 |
alias n='nano' |
| 48 |
rabit |
1.4 |
|
| 49 |
rabit |
1.1 |
# View processes without line wrapping (scrolling with cursor keys): |
| 50 |
|
|
alias pl='ps afux | less -S' |
| 51 |
rabit |
1.4 |
|
| 52 |
|
|
# Count of (running) processes: |
| 53 |
|
|
alias psc="p1=\`ps -A | wc -l\`; p2=\`ps auxr | wc -l\`; echo $HOSTNAME: \$[p1 - 2] processes, \$[p2 - 2] running." |
| 54 |
|
|
|
| 55 |
|
|
# A (slightly looong) one-liner, as mighty as Tux: :) |
| 56 |
|
|
# (change the NTP server to your needs, see 'http://www.ntp.org/') |
| 57 |
|
|
alias syncdate="echo -n 'NTP: '; date -s\"\`cat </dev/tcp/de.pool.ntp.org/13\`\"; echo -n 'Local: '; date; echo 'Date and time in sync.'" |
| 58 |
|
|
|
| 59 |
|
|
# Timestamp (good when backupping, result like '200401013_123152'): |
| 60 |
|
|
alias timestamp="date +'%Y%m%d_%H%M%S'" |
| 61 |
|
|
|
| 62 |
|
|
# Console fire with low priority |
| 63 |
|
|
alias fire="nice -n 19 aafire -dim -bold -reverse -normal -boldfont" |
| 64 |
|
|
|