{"id":793,"date":"2019-01-25T18:44:53","date_gmt":"2019-01-25T18:44:53","guid":{"rendered":"https:\/\/www.science.smith.edu\/sawlab\/?page_id=793"},"modified":"2019-01-28T17:14:02","modified_gmt":"2019-01-28T17:14:02","slug":"command-line-tutorial_2","status":"publish","type":"page","link":"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/","title":{"rendered":"Command Line Tutorial"},"content":{"rendered":"<p>Now that we know a few Unix commands, let&#8217;s do some bioinformatics.  Click here to download some sequence data:<\/p>\n<p> <a href=\"https:\/\/www.science.smith.edu\/sawlab\/wp-content\/uploads\/sites\/46\/2019\/01\/Archive.zip\">Archive.zip<\/a><\/p>\n<p>Find the file that was just downloaded &#8211; it should be in your Downloads folder, but if it is somewhere else, adjust the following commands accordingly.<\/p>\n<p>Go to your terminal. You should still be pointed into the folder we made, called Unix.  If not, use your Unix skills to point your terminal into the Unix folder.<\/p>\n<p>Now, lets use a new command:<\/p>\n<p><code>mv \/Users\/jgrant\/Downloads\/Archive.zip .<\/code><\/p>\n<p>The <strong>mv<\/strong> command moves a file from one place to another.  It takes two arguments, the file to be moved and the place you want to move it to.  In this case, we are moving the Archive.zip we just downloaded.  The second argument <strong>.<\/strong> is nickname for the folder we are currently pointed into (as we saw <strong>..<\/strong> is a nickname for the next folder up).  We could also have typed the full path for the folder:<\/p>\n<p><code>mv \/Users\/jgrant\/Downloads\/Sequences.zip \/Users\/jgrant\/Documents\/Bioinformatics\/Unix <\/code> <\/p>\n<p>but that is much more typing!  <\/p>\n<p>If you wanted to get a copy of the file and leave the original in the Downloads folder, you could have used <strong>cp<\/strong> (copy) instead of <strong>mv<\/strong> (move)<\/p>\n<p><code>cp \/Users\/jgrant\/Downloads\/Archive.zip .<\/code><\/p>\n<p>Sometimes this is safer, but you could also end up with multiple mostly unnecessary copies of files.<\/p>\n<p>To see what is in your folder now, type<\/p>\n<p><code>ls<\/code><\/p>\n<p><strong>ls<\/strong>, for list, lists all visible files in a directory.  You should see the Archive.zip file is now in the Unix folder.  The ls command seems pretty straightforward, but it actually has many options that make it more powerful and more useful.  To learn more about any Unix command, you can use <strong>man<\/strong> (for manual).  Type:<\/p>\n<p><code>man ls<\/code><\/p>\n<p>and look at the output.  The manual entry starts with the basic usage, how to use it and then gives a long list of options. For example: <\/p>\n<p><strong>ls -a<\/strong> will show all files in the directory (even hidden files!) and<br \/>\n<strong>ls -l<\/strong> will show more information about the files in the directory, including file size, permissions, and date modified. <\/p>\n<p>The <strong>man<\/strong> command can be used for any Unix command and is really useful if you forget how a command is used, or if you want to explore a command in more detail.<\/p>\n<p>Next, we want to unzip the archive with this command<\/p>\n<p><code>unzip Archive.zip<\/code><\/p>\n<p>NOTE:  <strong>unzip<\/strong> is not a unix command. It calls a program called unzip and runs it. It is possible that your computer wont have unzip installed, in which case you will get an error. If this happens, go ahead and use whatever program you usually use to decompress files.<\/p>\n<p>Now look in your folder with <strong>ls<\/strong>.  You should see many fasta files!<\/p>\n<p>Now you know<\/p>\n<li>cd<\/li>\n<li>mkdir<\/li>\n<li>mv<\/li>\n<li>cp<\/li>\n<li>ls<\/li>\n<li>man<\/li>\n<p>\nThat&#8217;s a lot of Unix!<\/p>\n<p>But there&#8217;s more!  <a href=\"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_3\/\">Next&#8230;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that we know a few Unix commands, let&#8217;s do some bioinformatics. Click here to download some sequence data: Archive.zip Find the file that was just downloaded &#8211; it should be in your Downloads folder, but if it is somewhere &hellip; <a href=\"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":73,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-793","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Command Line Tutorial - The Williams Lab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Command Line Tutorial - The Williams Lab\" \/>\n<meta property=\"og:description\" content=\"Now that we know a few Unix commands, let&#8217;s do some bioinformatics. Click here to download some sequence data: Archive.zip Find the file that was just downloaded &#8211; it should be in your Downloads folder, but if it is somewhere &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/\" \/>\n<meta property=\"og:site_name\" content=\"The Williams Lab\" \/>\n<meta property=\"article:modified_time\" content=\"2019-01-28T17:14:02+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/command-line-tutorial_2\\\/\",\"url\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/command-line-tutorial_2\\\/\",\"name\":\"Command Line Tutorial - The Williams Lab\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/#website\"},\"datePublished\":\"2019-01-25T18:44:53+00:00\",\"dateModified\":\"2019-01-28T17:14:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/command-line-tutorial_2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/command-line-tutorial_2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/command-line-tutorial_2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Command Line Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/#website\",\"url\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/\",\"name\":\"The Williams Lab\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.science.smith.edu\\\/sawlab\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Command Line Tutorial - The Williams Lab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/","og_locale":"en_US","og_type":"article","og_title":"Command Line Tutorial - The Williams Lab","og_description":"Now that we know a few Unix commands, let&#8217;s do some bioinformatics. Click here to download some sequence data: Archive.zip Find the file that was just downloaded &#8211; it should be in your Downloads folder, but if it is somewhere &hellip; Continue reading &rarr;","og_url":"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/","og_site_name":"The Williams Lab","article_modified_time":"2019-01-28T17:14:02+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/","url":"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/","name":"Command Line Tutorial - The Williams Lab","isPartOf":{"@id":"https:\/\/www.science.smith.edu\/sawlab\/#website"},"datePublished":"2019-01-25T18:44:53+00:00","dateModified":"2019-01-28T17:14:02+00:00","breadcrumb":{"@id":"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.science.smith.edu\/sawlab\/command-line-tutorial_2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.science.smith.edu\/sawlab\/"},{"@type":"ListItem","position":2,"name":"Command Line Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.science.smith.edu\/sawlab\/#website","url":"https:\/\/www.science.smith.edu\/sawlab\/","name":"The Williams Lab","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.science.smith.edu\/sawlab\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/pages\/793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/comments?post=793"}],"version-history":[{"count":15,"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/pages\/793\/revisions"}],"predecessor-version":[{"id":840,"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/pages\/793\/revisions\/840"}],"wp:attachment":[{"href":"https:\/\/www.science.smith.edu\/sawlab\/wp-json\/wp\/v2\/media?parent=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}