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).
asphodele · · focus · HN ↗
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)
imp0cat · · focus · HN ↗
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).
If you omit the trailing slash in the source path, rsync will create the target directory for you. See man rsync for more info.