{"id":500,"date":"2021-03-23T20:59:57","date_gmt":"2021-03-24T01:59:57","guid":{"rendered":"http:\/\/box5488.temp.domains\/~becomen3\/staging\/8495\/?p=500"},"modified":"2022-04-25T09:47:44","modified_gmt":"2022-04-25T14:47:44","slug":"the-terminal-commands-that-every-programmer-should-know","status":"publish","type":"post","link":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-terminal-commands-that-every-programmer-should-know\/","title":{"rendered":"The Terminal Commands that Every Programmer Should Know"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-terminal-commands-that-every-programmer-should-know\/#Prefer_to_watch_the_video\" >Prefer to watch the video?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-terminal-commands-that-every-programmer-should-know\/#Learning_the_terminologies_Understanding_what_the_Terminal_Console_Shell_CLI_Bash_and_PowerShell_mean\" >Learning the terminologies: Understanding what the Terminal, Console, Shell, CLI Bash, and PowerShell mean.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-terminal-commands-that-every-programmer-should-know\/#%E2%80%8DExecuting_Bash_commands_on_Windows\" >\u200dExecuting Bash commands on Windows<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-terminal-commands-that-every-programmer-should-know\/#Basic_Bash_commands\" >Basic Bash commands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-terminal-commands-that-every-programmer-should-know\/#Basic_CMD_commands_Only_Windows\" >Basic CMD commands (Only Windows)<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prefer_to_watch_the_video\"><\/span>Prefer to watch the video?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to use the Command Line or Terminal for Absolute Beginners\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/TC0x_iLR0Lg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Learning_the_terminologies_Understanding_what_the_Terminal_Console_Shell_CLI_Bash_and_PowerShell_mean\"><\/span><strong>Learning the terminologies: Understanding what the Terminal, Console, Shell, CLI Bash, and PowerShell mean.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The <strong>console <\/strong>is the hardware or the system running a terminal.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A terminal is a session of a shell.<\/li><li>A <strong>shell <\/strong>is a CLI that allows you to control your computer using different commands. &nbsp;<\/li><li>A <strong>CLI <\/strong>or Command Line Interface allows you to execute commands (input) and get results from it (output).<\/li><li>What about Bash and PowerShell?<\/li><li>\u200d<strong>Bash <\/strong>is one kind of Linux\/Unix shell.<\/li><li>\u200d<strong>PowerShell <\/strong>is the windows operative system\u2019s shell.<\/li><\/ul>\n\n\n\n<p>Although some shells have similar commands, many of the other commands are different, i.e. Bash commands are different from Powershell commands.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E2%80%8DExecuting_Bash_commands_on_Windows\"><\/span>\u200d<strong>Executing Bash commands on Windows<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>There\u2019s a way for you to execute Bash commands in a Windows machine. This is done by downloading and installing Git https:\/\/git-scm.com\/downloads, which is a version control, in your Windows machine. Git comes with other tools during the installation process, Git Bash being one of them. Git Bash is an emulator of Bash in a Windows machine. That doesn\u2019t mean you can have a Bash shell in a Windows machine. It means you can use Bash commands in a Windows machine.<\/p>\n\n\n\n<p>It\u2019s time for you to learn the basic commands any programmer should know.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Basic_Bash_commands\"><\/span><strong>Basic Bash commands<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Note: If you are on a Windows machine, Run these commands on Git Bash. You can execute these commands in the terminal if you have a MAC without the need of Git Bash. Just make sure it says Bash in the title as soon as you open the terminal.<\/p>\n\n\n\n<p><strong>cd + directory name<\/strong>: to change directory or current location in the terminal<\/p>\n\n\n\n<p><strong>cd ..<\/strong> : to change directory one step back in the terminal<\/p>\n\n\n\n<p><strong>ls<\/strong>: to display the list of files in the current location in the terminal<\/p>\n\n\n\n<p><strong>clear<\/strong>: to clear the history of inputs and outputs displayed on the terminal<\/p>\n\n\n\n<p><strong>touch + myFileName<\/strong> : to create file with name \u201cmyFileName\u201d in the current terminal location<\/p>\n\n\n\n<p><strong>rm + myFileName<\/strong>: to remove a file with the name \u201cmyFilename\u201d in the current terminal location<\/p>\n\n\n\n<p><strong>Key Up or Down<\/strong>: to see previous commands executed in the terminal<\/p>\n\n\n\n<p><strong>cp + myFileName + newLocation<\/strong>: to copy the file with the name \u201cmyFileName\u201d to a new location called \u201cnewLocation\u201d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Basic_CMD_commands_Only_Windows\"><\/span><strong>Basic CMD commands (Only Windows)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Note: I\u2019m not aware of any windows shell emulator that could be used in a Linux machine. If you are on a Linux machine, you probably won\u2019t be able to execute the following commands:<\/p>\n\n\n\n<p><strong>cd + directory name<\/strong>: to change directory or current location in the terminal<\/p>\n\n\n\n<p><strong>cd ..<\/strong> : to change directory one step back in the terminal<\/p>\n\n\n\n<p><strong>dir<\/strong>: to display the list of files in the current location in the terminal<\/p>\n\n\n\n<p><strong>cls<\/strong>: to clear the history of inputs and outputs displayed on the terminal<\/p>\n\n\n\n<p><strong>call &gt;&gt; + myFileName<\/strong> : to create file with name \u201cmyFileName\u201d in the current terminal location<\/p>\n\n\n\n<p><strong>rm + myFileName<\/strong>: to remove a file with the name \u201cmyFilename\u201d in the current terminal location<\/p>\n\n\n\n<p><strong>Key Up or Down<\/strong>: to see previous commands executed in the terminal<\/p>\n\n\n\n<p><strong>xcopy + myFileName + newLocation<\/strong>: to copy the file with the name \u201cmyFileName\u201d to a new location called \u201cnewLocation\u201d<\/p>\n\n\n\n<p>I have known developers, from junior to senior developers, who don&#8217;t know how to use the terminal. Sometimes, this could be frustrating especially when they need to access virtual machines using the terminal and they don\u2019t know the basic commands to get around. Although you don&#8217;t really need to know the terminal to become a programmer, I strongly advise you to learn the basic commands on your workstation\u2019s shell.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prefer to watch the video? Learning the terminologies: Understanding what the Terminal, Console, Shell, CLI Bash, and PowerShell mean. The console is the hardware or the system running a terminal. A terminal is a session of a shell. A shell is a CLI that allows you to control your computer using different commands. &nbsp; A &#8230; <a title=\"The Terminal Commands that Every Programmer Should Know\" class=\"read-more\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-terminal-commands-that-every-programmer-should-know\/\" aria-label=\"More on The Terminal Commands that Every Programmer Should Know\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":502,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-500","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programmers-knowledge","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/comments?post=500"}],"version-history":[{"count":2,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/500\/revisions"}],"predecessor-version":[{"id":2528,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/500\/revisions\/2528"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/media\/502"}],"wp:attachment":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/media?parent=500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/categories?post=500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/tags?post=500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}