🔥Terminal终端:
git remote set-url origin https://codeXXXXXXXXXXXXXXXXXXXX@github.com/elegantcoin/utils.git
登录gitalias gp="gitpush() {git push origin HEAD:refs/for/develop%topic='$1'};gitpush"
rsync --bwlimit=1000 -artP file1 -e 'ssh -p xxxx' user@targetmachine:file2
cat cmd_lines_2022-05_15.log|egrep -E "history lines |\(103\)"
split -l 1000 -a 3 bigfiles.txt smallfiles.txt
split filesmysql/redis-cli -h service -P xxxx -u username -p password
mysqldocker ps
dockerdocker commit 1234 softeorename:v2.0
docker commitdocker save -o softeorename.tar softeorename:v2.0
docker savedocker load -i softeorename.tar
docker loaddocker run -dit -v /tmp/localpath:home --name softeorename softeorename:v2.0
docker exec -it 100 /bin/bash
keys * / get key 100
redistar -cvf compress.tar /filefolder --exclude=./.ssh
tartar cf /tmp/compress.tar /big/tree --exclude-from <(find /big/tree -size +3M)
tartar czf /tmp/compress.tar |split -b 1000m - small-file.tar
split tar filefind /tmp/path -3M|xargs tar cf /tmp/compress.tar
tar fills <3M in pathfind ./ -name "*" -size +3M
find files >3Mfind ./ -name "*.txt|xargs cat >3.txt"
cat into one filefind . -name "*.txt" | xargs -i cp {} /home/users/
find -type f -print | xargs grep "include" | awk '{gsub(":"," ");print $1}' | uniq -c
find ./ -name "*include*" | awk '{print $1}'
wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
get anancondavim ~/.bash_history
vim ~/.bashrc
vim ~/.bash_profile
mkdir -vp temp1/subdir/subdir
nohup jupyter 2>&1 &
nohupjupyter notebook >jupyter.log 2>&1 &
ps -aux |egrep test.sh|egrep -v grep|awk '${print $0}'|sort -k 2 -n
ps -aux|egrep python |xargs kill -9
careful if root userps -eo pid,sgi_p,cmd --sort sgi_p|egrep "python"
magick -loop 0 -delay 10 fram*.jpg frame.gif
generate gifsrsvg-convert -z 10.0 pprof001_true.svg >pprof001.png
convert to pngtree -df
tree dirtree -L 3
tree 3 levelstree -dfIL "*anaconda*|*git*" 3
tree ignore keywordsrename 's/\.jpeg/\.jpg' *.jpeg
rename using regxcat my_log.log|egrep ''$'\t123'$'\tsname'|sort -k 1 -k 2
egrep \t and sortls --sort=none
no sorting when ls(useful in huge files folder)aek '! a[$0]++'
drop duplicatesed -i'.bak' 's/words/word/g' my_log.log
replace globalpython -m cProfile my_script.py
cProfilego tool pprof cpu.out
go Profile/bin/spark2-submit --master yarn --deploy-mode client --queue username --driver-memory 32g --executor-cores 10 --executor-memory 32g
sparkdate -d @${1:0:10}.${1:10} +'%F %H:%M:%S'
把1678617600123213300 形式的转换成字符串形式date -d "2015-08-04 10:30:45" +%s%N
把字符串转换为时间戳
file_names=$(ls *.txt)
file_arr=($file_names)
var_arr=($file_arr)
i=0
for s_one in $file_names;do
((i++))
my_count=$(cat $s_one |wc -l)
my_content=$(sed 's/\\n/\\\\n/g' $s_one)
echo "${var_arr[${i}]}"
echo "#\n#${s_one}|${my_count}\n\n${my_content}\n\n" >>all.txt
mv file_$i.qgz file${s_one}.qgz
auto_triger() {
msg=$1
echo ${msg}
}
auto_triger "this is a func"
30 09 * * * cd /tmp/robot && sh start_robot.sh >>robot.log 2>&1
rm -f perf.*
sudo perf record -e cpu-clock -p $1 -g -F 99 -o perf.data -- sleep 20
sudo perf script -i perf.data &> perf.unfold
sudo /opt/FlameGraph/stackcollapse-perf.pl perf.unfold &> perf.folded
sudo /opt/FlameGraph/flamegraph.pl perf.folded > perf.svg
rm perf.unfold perf.folded in-fb.data