{"id":143,"date":"2013-01-19T23:42:03","date_gmt":"2013-01-19T23:42:03","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=143"},"modified":"2017-03-06T01:26:04","modified_gmt":"2017-03-06T01:26:04","slug":"how-ftp-multiple-files-from-the-command-line","status":"publish","type":"post","link":"https:\/\/www.theSQLReport.com\/?p=143","title":{"rendered":"How FTP Multiple Files from the Command Line"},"content":{"rendered":"<p>Many times I am challenged to move many similar files from one server to another.\u00a0 Either I have to remote-desktop on to the server (Windows), or have a session on the server (AIX, Linux).\u00a0 In these situations, I do not have a nice GUI utility, like FTP Voyager, setup to move my files.\u00a0 There are some good basic commands in FTP that make life easier to move many like files.<\/p>\n<p style=\"padding-left: 30px;\">C:\\ ftp &lt;my server name&gt;<\/p>\n<p style=\"padding-left: 30px;\">ftp&gt; bin<\/p>\n<p style=\"padding-left: 30px;\">ftp&gt; prompt no<\/p>\n<p style=\"padding-left: 30px;\">ftp&gt; mget &lt;start of the like files&gt; *<\/p>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Commandline.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-144\" title=\"FTP_Commandline\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Commandline.jpg\" alt=\"\" width=\"739\" height=\"886\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Commandline.jpg 739w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Commandline-250x300.jpg 250w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Commandline-175x210.jpg 175w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/a><\/p>\n<p>Below are commands that I use to move multiple files at in a couple commands.<\/p>\n<p><strong>binary<\/strong> or <strong>bin: <\/strong>when you set to binary mode, you\u2019ll receive a message \u201c200 Type set to I\u201d.\u00a0 The default mode for FTP is ASCII.\u00a0 Binary mode transmits the raw bytes of a file.\u00a0 This is useful when moving zipped or executable file.\u00a0 If you transmit your executable or zipped file in ASCII mode, you may find it corrupted on the receiving server.\u00a0 To save time &amp; typing, you can type &#8220;bin&#8221;, and the FTP utility will recognize it as the command \u201cbinary\u201d.<\/p>\n<p><strong>prompt no: <\/strong>by default the prompt is set on to check if you want the download the file.\u00a0 When you set your prompt mode to no, your will get an message \u201cInteractive mode OFF\u201d.\u00a0 By setting the prompt to no, the FTP utility will automatically download multiple files without prompting.<\/p>\n<p style=\"padding-left: 60px;\">Below is an example of being prompted for each file &amp; why you may want to avoid this (you have to type either y or n for each file):<\/p>\n<p style=\"padding-left: 120px;\"><em>&#8212; very bad if you have to move hundreds to thousands of files<\/em><\/p>\n<p style=\"padding-left: 60px;\"><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Prompt_Yes.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-147\" title=\"FTP_Prompt_Yes\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Prompt_Yes.jpg\" alt=\"\" width=\"577\" height=\"306\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Prompt_Yes.jpg 577w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Prompt_Yes-300x159.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2013\/01\/FTP_Prompt_Yes-210x111.jpg 210w\" sizes=\"(max-width: 577px) 100vw, 577px\" \/><\/a><\/p>\n<p><strong>mget: <\/strong>this command can retrieve multiple files at a time.\u00a0 View some of the example below:<\/p>\n<p style=\"padding-left: 60px;\"><strong>FTP&gt; mget file01 file02 file03<\/strong><\/p>\n<p style=\"padding-left: 90px;\"><em>separate each file with a space<\/em><\/p>\n<p style=\"padding-left: 60px;\"><strong>FTP&gt; mget filename*<\/strong><\/p>\n<p style=\"padding-left: 60px;\"><strong>FTP&gt; mget *.txt<\/strong><\/p>\n<p style=\"padding-left: 90px;\"><em>start or finish with the common characters in the file name, and the star (*) can be used as a wildcard character<\/em><\/p>\n<p><strong>mput: <\/strong>this command is used like mget to upload multiple file to the remote computer<\/p>\n<p style=\"padding-left: 60px;\"><strong>FTP&gt; mput file01 file02 file03<\/strong><\/p>\n<p style=\"padding-left: 90px;\"><em>separate each file with a space<\/em><\/p>\n<p style=\"padding-left: 60px;\"><strong>FTP&gt; mput filename*<\/strong><\/p>\n<p style=\"padding-left: 60px;\"><strong>FTP&gt; mput *.txt<\/strong><\/p>\n<p style=\"padding-left: 90px;\"><em>start or finish with the common characters in the file name, and the star (*) can be used as a wildcard character<\/em><\/p>\n<p><strong>Why I write this:<\/strong><\/p>\n<p>When I started working more with linux &amp; AIX operating systems, I remember spending a lot of time to put together all the commands that I would need to upload system patches or to script the movement of log files.\u00a0 This week, cleaning up my personal folder, I found the notes I had to put these together.\u00a0 My hope is that these notes helps someone cut down on the number of message board they have to search to find the commands need to accomplish these tasks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many times I am challenged to move many similar files from one server to another.\u00a0 Either I have to remote-desktop on to the server (Windows), or have a session on &hellip; <a class=\"readmore\" href=\"https:\/\/www.theSQLReport.com\/?p=143\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":144,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,8,10],"tags":[],"class_list":["post-143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aix","category-linux","category-windows"],"_links":{"self":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/143"}],"collection":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=143"}],"version-history":[{"count":19,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":1361,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions\/1361"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/144"}],"wp:attachment":[{"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}