Created
November 16, 2015 03:00
-
-
Save Teino1978-Corp/ee12e88751ce9e26cac1 to your computer and use it in GitHub Desktop.
Lean the command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basic command | |
uname -a | |
cat /etc/proc/version | |
# zip / unzip | |
tar -czvf shared.tar.gz shared | |
tar -tzvf shared.tar.gz | |
tar -xzvf shared.tar.gz | |
gzip 1.js | |
gzip -d *.gz | |
gzip -c 1.js > 1.js.gz | |
# low priority for CPU | |
nice -19 tar cfz 29-timer.log.tar.gz 29-timer.log | |
# disk usage | |
df -hl | |
du -sh ./* | |
# remove many files | |
ls | xargs rm -f | |
# find last 300 minutes and remove | |
find . -type f -mmin -300 | xargs rm -f | |
# show log and cut to 1 line | |
tail -f /opt/logs/*/23-20130822 | grep "Aug" | awk -F '\x01' '{print(substr($1,34,155))}' | |
# show execute time | |
time ./***.sh | |
# do not seperate line | |
echo $(date; cat ***| wc-l) | |
# run every 5 seconds | |
while sleep 5; do date; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basic command | |
uname -a | |
cat /etc/proc/version | |
# zip / unzip | |
tar -czvf shared.tar.gz shared | |
tar -tzvf shared.tar.gz | |
tar -xzvf shared.tar.gz | |
gzip 1.js | |
gzip -d *.gz | |
gzip -c 1.js > 1.js.gz | |
# low priority for CPU | |
nice -19 tar cfz 29-timer.log.tar.gz 29-timer.log | |
# create local tar ball from remote host folders | |
$ ssh user@remotehost "cd /var/www/html; tar cvfz - datafolder" > datafolder.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# disk usage | |
df -hl | |
du -sh ./* | |
# remove many files | |
ls | xargs rm -f | |
# find last 300 minutes and remove | |
find . -type f -mmin -300 | xargs rm -f | |
# show log and cut to 1 line | |
tail -f /opt/logs/ec2-us-sco2-prod-web*/23-20130822 | grep "Aug" | awk -F '\x01' '{print(substr($1,34,155))}' | |
# show execute time | |
time ./***.sh | |
# do not seperate line | |
echo $(date; cat ***| wc-l) | |
# run every 5 seconds | |
while sleep 5; do date; done | |
time dd bs=1M count=1024 if=/dev/zero of=test.file conv=fdatasync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basic command | |
uname -a | |
cat /etc/proc/version | |
# zip / unzip | |
tar -czvf shared.tar.gz shared | |
tar -tzvf shared.tar.gz | |
tar -xzvf shared.tar.gz | |
gzip 1.js | |
gzip -d *.gz | |
gzip -c 1.js > 1.js.gz | |
# low priority for CPU | |
nice -19 tar cfz 29-timer.log.tar.gz 29-timer.log | |
# disk usage | |
df -hl | |
du -sh ./* | |
# remove many files | |
ls | xargs rm -f | |
# find last 300 minutes and remove | |
find . -type f -mmin -300 | xargs rm -f | |
# show log and cut to 1 line | |
tail -f /opt/logs/ec2-us-sco2-prod-web*/23-20130822 | grep "Aug" | awk -F '\x01' '{print(substr($1,34,155))}' | |
# show execute time | |
time ./***.sh | |
# do not seperate line | |
echo $(date; cat ***| wc-l) | |
# run every 5 seconds | |
while sleep 5; do date; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat redis_monitor_repeat.sh | |
while sleep 5; do ./redis_monitor.sh | tr -t '\n' ','; date +"%Y-%m-%d %H:%M:%S"; done | |
$ cat redis_monitor.sh | |
date +"%Y-%m-%d %H:%M:%S" | |
date_start=$(date +%s) | |
cat redis.cmd | redis-cli | |
date_end=$(date +%s) | |
echo $((date_end-date_start)) | |
$ cat redis.cmd | |
SELECT 1 | |
get REQUEST_COUNT | |
SLOWLOG LEN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -type f | grep -vE "^./.git|^./tmp" | xargs -I {} chmod 660 {} | |
find . -type d | grep -vE "^./.git|^./tmp|^.$" | xargs -I {} chmod 770 {} | |
head -n 100 tutorial_1209.csv | grep -o "^[0-9]\+" | xargs -n1 sh user_size.sh > size.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment