Skip to main content

Download Files From Remote to local via command line


To download Files From Remote to local via command line  normally we use scp.

To copy all from Local Location to Remote Location (Upload)
scp -r /path/from/destination username@hostname:/path/to/destination
Copy on current directory from Remote to Local
scp -r username@hostname:/path/from/file .

To download a single file the command will be:

scp user@your.server.example.com:/path/to/foo/file.name /home/user/Desktop/

To download a single file the command will be: 

scp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/

Help:

  1. -r Recursively copy all directories and files
  2. Always use full location from /, Get full location by pwd
  3. scp will replace all existing files
  4. hostname will be hostname or IP address
  5. if custom port is needed (besides port 22) use -P portnumber
  6. . (dot) - it means current working directory, So download/copy from server and paste here only

Comments

Popular posts from this blog

Things you need to know about cron

cron is a Linux utility which schedules a command or script on your server to run automatically at a  specified  time and date.  They're most commonly used for automating system maintenance or administration. However, they are also relevant to web application development.   Why use cron?  Server admins have been using cron jobs for a long time.   You can expire and erase cached data files in a certain interval. You can auto-check your website content for broken links and have a report e-mailed to yourself regularly. Can update your database from external api  Syntax Here is a simple cron job: 1 10 * * * * /usr/bin/php /www/virtual/username/cron.php > /dev/null 2>&1 It consists of five parts: minute hour day of month month day of week Can generate the sequence from  crontab guru ,    https://crontab.guru/every-30-minutes Editing the Crontab Running this command wil...

Git Repair Permissions

Git Push Error: insufficient permission for adding an object to repository database When you try to push to a shared git remote, you get the following error:  insufficient permission for adding an object to repository database After you have identified and fixed the underlying cause (see below), you’ll want to repair the permissions: cd /path/to/repo.git chgrp -R groupname . chmod -R g+rwX . find . -type d -exec chmod g+s '{}' + Underlying Causes The error could be caused by one of the following: The repository isn’t configured to be a shared repository (see  core.sharedRepository  in  git help config ). If the output of: git config core.sharedRepository is not  group  or  true  or  1  or some mask, try running: git config core.sharedRepository group and then re-run the recursive  chmod  and  chgrp  (see “Repair Permissions” above). The operating system doesn’t interpret a setgid bit o...