{"id":902,"date":"2019-06-26T11:53:12","date_gmt":"2019-06-26T10:53:12","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/htccondor\/?page_id=902"},"modified":"2019-06-26T11:53:12","modified_gmt":"2019-06-26T10:53:12","slug":"linux-mac-command-line-tools","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/getting-started\/file-transfer\/linux-mac-command-line-tools\/","title":{"rendered":"Linux\/Mac command-line tools"},"content":{"rendered":"<h2>Command-line Tools<\/h2>\n<p>Linux and Mac users can use the command-line to transfer files. While GUI programs do exist, we find the command-line more reliable, if a little more difficult to begin with.<\/p>\n<p>Open a <em>Terminal<\/em> app on your Linux or Mac desktop to give yourself a command-line. The following commands can then be used. Please note, type them carefully (or cut-n-paste). The commands are sensitive to where the spaces occur and additional characters.<\/p>\n<p>In all of the commands below, replace <code><em>username<\/em><\/code> with your own IT username.<\/p>\n<h2>rsync<\/h2>\n<p>The <code>rsync<\/code> command is used to transfer files securely and efficiently between your PC\/laptop and Condor. No installation is usually needed on Linux or Mac systems (it is there by default). It has some nice features for resuming interrupted transfers (no need to transfer everything again) and can be used to keep folders on your PC and Condor <em>in-sync<\/em> &#8211; i.e., it can detect which files are new or have changed and only copy those.<\/p>\n<p>The following commands are run <em>on your PC\/laptop<\/em>, NOT within Condor. Please type them carefully (notice the <code>:<\/code> between Condor and the file or folder names after it).<\/p>\n<ul>\n<li>Upload a file <em>from<\/em> your local machine <em>to<\/em> your Condor <em>home<\/em> directory (the <code>~<\/code> at the end is short-hand for <em>your Condor home folder<\/em>)\n<pre>rsync -avz myinput.dat <em>username<\/em>@submitter.itservices.manchester.ac.uk<strong>:~\/.<\/strong>\r\n<\/pre>\n<\/li>\n<li>Download a file <em>from<\/em> your Condor home directory to your local machine (don&#8217;t forget the <strong><code>.<\/code><\/strong> at the end to mean the <em>current folder<\/em> on your PC)\n<pre>rsync -avz <em>username<\/em>@submitter.itservices.manchester.ac.uk:~\/myresult.dat  <strong>.<\/strong>\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>The <code>-avz<\/code> flag on the <code>rsync<\/code> command will run it in <em>archive<\/em> mode (it will transfer all files in a folder if a folder name is given instead of a filename and it will preserve the timestamps on files), it will be <em>verbose<\/em> (displaying filenames as it transfers them) and it will <em>compress<\/em> traffic to try to reduce the transfer time (files will be compressed before transfer and decompressed when received). Please check the <code>rsync<\/code> documentation using <code>man rsync<\/code> on your system.<\/p>\n<h2>scp or sftp<\/h2>\n<p>The commands <code>scp<\/code> or <code>sftp<\/code> will both transfer files in a similar manner to <code>rsync<\/code>, although rsync offers more options.<\/p>\n<ul>\n<li>Upload a file <em>from<\/em> your local machine <em>to<\/em> your Condor home directory (don&#8217;t forget the <strong><code>:<\/code><\/strong> at the end)\n<pre>scp myinput.dat <em>username<\/em>@submitter.itservices.manchester.ac.uk:~\/.\r\n<\/pre>\n<\/li>\n<li>Download a file <em>from<\/em> your Condor home directory <em>to<\/em> your local machine (don&#8217;t forget the <strong><code>.<\/code><\/strong> at the end to mean the <em>current folder<\/em> on your PC)\n<pre>scp <em>username<\/em>@submitter.itservices.manchester.ac.uk:results.out  <strong>.<\/strong><\/pre>\n<\/li>\n<\/ul>\n<p>Remember that all of the above commands are run in a terminal on your laptop\/desktop and ARE NOT logged-in to Condor.<\/p>\n<h2>More information<\/h2>\n<p>Please see the <code>man<\/code> for the command for more help (e.g., <code>man rsync<\/code>). Alternatively have a look at the online docs:<\/p>\n<ul>\n<li><a href=\"https:\/\/linux.die.net\/man\/1\/rsync\">rsync<\/a><\/li>\n<li><a href=\"https:\/\/linux.die.net\/man\/1\/scp\">scp<\/a><\/li>\n<li><a href=\"https:\/\/linux.die.net\/man\/1\/sftp\">sftp<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Command-line Tools Linux and Mac users can use the command-line to transfer files. While GUI programs do exist, we find the command-line more reliable, if a little more difficult to begin with. Open a Terminal app on your Linux or Mac desktop to give yourself a command-line. The following commands can then be used. Please note, type them carefully (or cut-n-paste). The commands are sensitive to where the spaces occur and additional characters. In all.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/getting-started\/file-transfer\/linux-mac-command-line-tools\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"parent":67,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-902","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/pages\/902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/comments?post=902"}],"version-history":[{"count":3,"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/pages\/902\/revisions"}],"predecessor-version":[{"id":909,"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/pages\/902\/revisions\/909"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/pages\/67"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/htccondor\/wp-json\/wp\/v2\/media?parent=902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}