Linux bash常用命令案例记录

  1. scp (if the private key is id_rsa, [-i] can be removed)
    scp -i key -P port localfile user@ip:path

  2. back to the beginning of line
    Ctrl + a

  3. go to the end of line
    Ctrl + e

  4. cut character from current position to the beginning
    Ctrl + u

  5. cut character from current position to the end
    Ctrl + k

  6. set timezone
    timedatectl set-timezone Asia/Hong_Kong

  7. run in background
    nohup command > logfile 2>&1 &

  8. use ImageMagick to crop an image file(WIDTHxHEIGHT+X+Y)
    convert input.jpg -crop 100x100+12+34 output.jpg

  9. use ImageMagick to concatenate different size image files
    horizontally
    convert +append image1.jpg image2.jpg image3.jpg output.jpg
    vertically
    convert -append image1.jpg image2.jpg image3.jpg output.jpg

posted @ 2024-05-02 21:15  摩斯乱码  阅读(8)  评论(0)    收藏  举报