{"id":80,"date":"2012-07-23T12:27:21","date_gmt":"2012-07-23T16:27:21","guid":{"rendered":"http:\/\/aaronlockard.com\/?p=80"},"modified":"2012-07-23T12:27:21","modified_gmt":"2012-07-23T16:27:21","slug":"terminal-fun-the-basic-commands","status":"publish","type":"post","link":"https:\/\/aaronlockard.com\/?p=80","title":{"rendered":"Terminal Fun: The Basic Commands"},"content":{"rendered":"<p>Today I will introduce you to the wonderful wacky world of Terminals! First let&#8217;s open your terminal, this will vary depending on what distribution of Linux you are running. For Kubuntu you can open it by clicking the launcher -&gt; Click in the top search bar -&gt; Type &#8220;Konsole&#8221; -&gt; Press Enter. You should then be greeted with a screen similair to this.<\/p>\n<figure id=\"attachment_81\" aria-describedby=\"caption-attachment-81\" style=\"width: 587px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/aaronlockard.com\/wp-content\/uploads\/2012\/07\/Konsole_Empty.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-81\" title=\"Konsole Empty Session\" src=\"http:\/\/aaronlockard.com\/wp-content\/uploads\/2012\/07\/Konsole_Empty.png\" alt=\"Empty Terminal Session\" width=\"587\" height=\"350\" \/><\/a><figcaption id=\"caption-attachment-81\" class=\"wp-caption-text\">Konsole showing an empty terminal session<\/figcaption><\/figure>\n<p>First let&#8217;s get a feel for navigating around the terminal session. For this will will use the command CD also known as &#8220;Change Directory&#8221;. You can CD to many places within your file system quite easily, for example you could use these commands<\/p>\n<p><strong>cd \/<\/strong> <em>This command will take you to the root of your current file system<\/em><\/p>\n<p><strong>cd ~<\/strong> <em>This will take you to the current users documents home folder<\/em><\/p>\n<p><strong>cd ..<\/strong> <em>This will take you up one directory<\/em><\/p>\n<p>So if you were interested in checking out your friends documents you could type this command <strong>cd \/home\/friend\/documents<\/strong>\u00a0and it would change the terminal to be in your friends documents folder. Now the question is how do you see what&#8217;s in this folder. In order to view files and folders from within the terminal you need to use the command ls meaning to list the contents. You can simply type <strong>ls<\/strong> within the terminal to see a basic list of it&#8217;s contents however unlike <strong>cd<\/strong> there are many switches that can be turned on for <strong>ls<\/strong>. Let&#8217;s now go over several of the switches for <strong>ls<\/strong>.<\/p>\n<p>If you just type ls you will see all folders that are easily accessible meaning you will not see files or folders that are hidden. To see all contents you may type <strong>ls -a\u00a0<\/strong>You will know the file\/folder is hidden if it begins with a period like this <strong>.hidden<\/strong>\u00a0<\/p>\n<p>So now you have navigated successfully to your friends documents folder and seen it&#8217;s contents everything seems rather boring but you spot one file named secrets.txt. Now how could you view this text files contents from within the terminal? Well there are many ways but of of the easiest is to use cat like this:<\/p>\n<figure id=\"attachment_83\" aria-describedby=\"caption-attachment-83\" style=\"width: 587px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/aaronlockard.com\/wp-content\/uploads\/2012\/07\/konsole_secrets.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-83\" title=\"Konsole Cat Command\" src=\"http:\/\/aaronlockard.com\/wp-content\/uploads\/2012\/07\/konsole_secrets.png\" alt=\"Using the Cat Command in Konsole\" width=\"587\" height=\"202\" \/><\/a><figcaption id=\"caption-attachment-83\" class=\"wp-caption-text\">Using the Cat Command in Konsole<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Today I will introduce you to the wonderful wacky world of Terminals! First let&#8217;s open your terminal, this will vary&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/aaronlockard.com\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aaronlockard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aaronlockard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aaronlockard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aaronlockard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":0,"href":"https:\/\/aaronlockard.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"wp:attachment":[{"href":"https:\/\/aaronlockard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aaronlockard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aaronlockard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}