栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

一些常用的linux命令

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

一些常用的linux命令

这里写自定义目录标题
    • :fire:Terminal终端:

Terminal终端:
  • git remote set-url origin https://codeXXXXXXXXXXXXXXXXXXXX@github.com/elegantcoin/utils.git 登录git
  • 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 files
  • mysql/redis-cli -h service -P xxxx -u username -p password mysql
  • docker ps docker
  • docker commit 1234 softeorename:v2.0 docker commit
  • docker save -o softeorename.tar softeorename:v2.0 docker save
  • docker load -i softeorename.tar docker load
  • docker run -dit -v /tmp/localpath:home --name softeorename softeorename:v2.0
  • docker exec -it 100 /bin/bash
  • keys * / get key 100 redis
  • tar -cvf compress.tar /filefolder --exclude=./.ssh tar
  • tar cf /tmp/compress.tar /big/tree --exclude-from <(find /big/tree -size +3M) tar
  • tar czf /tmp/compress.tar |split -b 1000m - small-file.tar split tar file
  • find /tmp/path -3M|xargs tar cf /tmp/compress.tar tar fills <3M in path
  • find ./ -name "*" -size +3M find files >3M
  • find ./ -name "*.txt|xargs cat >3.txt" cat into one file
  • wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh get ananconda
  • vim ~/.bash_history
  • vim ~/.bashrc
  • vim ~/.bash_profile
  • nohup jupyter 2>&1 & nohup
  • jupyter 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 user
  • ps -eo pid,sgi_p,cmd --sort sgi_p|egrep "python"
  • magick -loop 0 -delay 10 fram*.jpg frame.gif generate gifs
  • rsvg-convert -z 10.0 pprof001_true.svg >pprof001.png convert to png
  • tree -df tree dir
  • tree -L 3 tree 3 levels
  • tree -dfIL "*anaconda*|*git*" 3 tree ignore keywords
  • rename 's/.jpeg/.jpg' *.jpeg rename using regx
  • cat my_log.log|egrep ''$'t123'$'tsname'|sort -k 1 -k 2 egrep t and sort
  • ls --sort=none no sorting when ls(useful in huge files folder)
  • aek '! a[$0]++' drop duplicate
  • sed -i'.bak' 's/words/word/g' my_log.log replace global
  • python -m cProfile my_script.py cProfile
  • go 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 spark
    # Python zip() behavior in bash
    file_names=$(ls *.txt)
    file_arr=($file_names)
    var_arr=($file_arr)
    i=0
    for s_one in $file_names;do
    ((i++))
    # head my_log.log|awk -F ',' '{printf("%s %sn",split($0,var_arr,","),var_arr[1])}
    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}nn${my_content}nn" >>all.txt
    mv file_$i.qgz file${s_one}.qgz
  • ``
    # function in bash
    auto_triger() {
        msg=$1
        echo ${msg}
    }
    auto_triger "this is a func"
  • ``
    # crontab -l -e
    30 09 * * * cd /tmp/robot && sh start_robot.sh >>robot.log 2>&1
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/886743.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号