‹ BackHN Continuity

Thread

Small programming tricks

681 points · 294 comments · signa11

  1. asphodele · · focus · HN ↗
    A few tidbits I wish I had known about sooner:

    bash: Ctrl-L to clear the screen

    VSCodium: Shift+Alt+[arrows|mouse click] to select a rectangular block

    scp for moving files (instead of ftp)

    1. imp0cat · · focus · HN ↗
      Yes, but try rsync instead of scp. Mind the slash though!

      Both rsync -avz /path/to/file user@server:/another/path/to/ or rsync -avz /path/to/file/ user@server:/another/path/to/file

      Will create directory named /another/path/to/file which will contain all contents of the original directory (/path/to/file/*).

      Basically, if you include the trailing slash in the source path, only contents of the directory will be copied (useful when you need to rename it).

          rsync -avz path/to/old_dir/ user@server:/path/to/new_dir
      
      If you omit the trailing slash in the source path, rsync will create the target directory for you. See man rsync for more info.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.