{"id":2527,"date":"2013-07-14T05:27:56","date_gmt":"2013-07-13T19:27:56","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=2527"},"modified":"2013-07-14T05:27:56","modified_gmt":"2013-07-13T19:27:56","slug":"more-linux-bash-mac-terminal-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/more-linux-bash-mac-terminal-tutorial\/","title":{"rendered":"More Linux Bash Mac Terminal Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"More Linux Bash Mac Terminal Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/LinuxBashViaMacTerminalPrimer\/LinuxBashViaMacTerminalPrimer.jpg\" title=\"More Linux Bash Mac Terminal Tutorial\" \/><\/a><p class=\"wp-caption-text\">More Linux Bash Mac Terminal Tutorial<\/p><\/div>\n<p id='lbmtabove'>This tutorial follows up on &#8230; <a title='Linux Bash Mac Terminal Tutorial' href='#lbmtbelow'>Linux Bash Mac Terminal Tutorial<\/a>.   We delve more into the wonderful world of Linux and the command line with an approach of &#8220;doing some things&#8221;.    With command line work it is easier to learn this way.   Within reason, there is nothing stopping you trying things, and that way, as long as you are careful, and use &#8220;help&#8221; and &#8220;man&#8221; a lot before doing something, you can learn a lot about the underlying operating system of your computer.   In our case this is a Mac laptop and using the Mac application Terminal to delve into this very interesting and huge field of study.     You could do things for days with all the possibilities, and really would like to think you get in there and try ideas out for yourself.   One of the little slides below, for instance is called the &#8220;three P&#8217;s&#8221;  and shows you &#8220;Hello World&#8221; from the Linux Bash command line for PHP, Perl and Python &#8230; so when I said &#8220;days&#8221; what I should have said was &#8220;years&#8221;!   As always there are good sources of information on the web.<\/p>\n<p>Let&#8217;s look at some command line Linux Bash commands:<\/p>\n<ul>\n<li><b>pwd &#8230; find &#8230; cd &#8230; ls &#8230; cat<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-6of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-6of.png','_blank');\" \/><\/img>\n<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-7of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-7of.png','_blank');\"  \/><\/img>\n<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-8of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-8of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>cat | cut\/awk<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-9of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-9of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>cat | sed\/tr<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-10of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-10of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>cat &#8230; head &#8230; tail | grep\/wc<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-11of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-11of.png','_blank');\"  \/><\/img>\n<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-13of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-13of.png','_blank');\"  \/><\/img>\n<\/li>\n<li>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-14of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-14of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>df -k &#8230; ps -ef<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-17of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-17of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>who am i<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-18of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-18of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>help<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-19of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-19of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>cat &#8230; tail | awk<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-21of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-21of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>The Three &#8220;P&#8217;s&#8221;<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-22of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-22of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>whereis<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-23of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-23of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b> &#8230; cut | sort<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas_24of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas_24of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>stat<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas_25of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas_25of.png','_blank');\"  \/><\/img>\n<\/li>\n<li><b>find &#8230; -exec &#8211; Find a file and act (with actions) on each file<\/b><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-26of.jpg\" alt=\"Idea ... click for better new window view\" title=\"Idea ... click for better new window view\" onclick=\"window.open('http:\/\/www.rjmprogramming.com.au\/Linux\/Tutorial\/Linux_Ideas-26of.png','_blank');\"  \/><\/img>\n<\/li>\n<\/ul>\n<p><strong><em>Did you know?<\/em><\/strong><\/p>\n<ul>\n<li>\n<p>In a Mac Linux Bash Terminal session command-T is a quick way to open a new shell.<\/p>\n<\/li>\n<li>\n<p>If you are in the middle of a program like &#8220;mail&#8221; when you go control-T you get a snapshot like &#8220;load: 1.35  cmd: mail 21804 waiting 0.00u 0.00s&#8221;<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p id='lbmtbelow'>Previous tutorial below &#8230; <a target=_blank title='Linux Bash Mac Terminal Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=331'>Linux Bash Mac Terminal Tutorial<\/a> &#8230;<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/LinuxBashViaMacTerminalPrimer\/iFrame.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Linux Bash Mac Terminal\" src=\"http:\/\/www.rjmprogramming.com.au\/LinuxBashViaMacTerminalPrimer\/LinuxBashViaMacTerminalPrimer.jpg\" title=\"Linux Bash Mac Terminal\" style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Linux Bash Mac Terminal<\/p><\/div>\n<p><a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/LinuxBashViaMacTerminalPrimer\/iFrame.html'>Tutorial<\/a> &#8230;<\/p>\n<p><strong><\/p>\n<p>Transcript:<\/p>\n<p><\/strong><\/p>\n<p>Do you own a Mac laptop or desktop?<\/p>\n<p>Have you heard of the application Terminal?<\/p>\n<p>It is like Command Prompt in Windows and if you know Bash scripting it can open a<br \/>\n    whole new world of possibilities with your Mac.  The operating system is Linux.<\/p>\n<p>If you are a beginner you need to start slowly, and in this tutorial we will only do<br \/>\n    benign commands that read rather than write.<\/p>\n<p>We&#8217;ll do a bit of:<\/p>\n<p>pwd<br \/>\necho<br \/>\ncd<br \/>\nls<br \/>\ncat<br \/>\nmore<br \/>\nps<br \/>\ndf<\/p>\n<p>In your search engine look for &#8220;Linux commands&#8221; for further information.   Once you see<br \/>\n   a command of interest, at Linux (with Bash) you can type:<\/p>\n<p>man [command]<\/p>\n<p>&#8230; to find further information.<\/p>\n<p>So here goes &#8230; we will open the Terminal application &#8230; then run a preprepared<br \/>\n   Bash script &#8230; but just concentrate on its commands, rather than doing scripting<br \/>\n   &#8230; that is for later &#8230; at the end of the presentation the Bash script is typed<br \/>\n   out for you.\n<\/p>\n<p><strong>Let&#8217;s explore some more Linux Bash shell commands below on 20\/3\/2013 &#8230;<\/strong><\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/ss64.com\/bash\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Linux Bash Mac Terminal ... more\" src=\"http:\/\/www.rjmprogramming.com.au\/wordpress\/linux-bash-more.jpg\" title=\"Linux Bash Mac Terminal ... more ... thanks to http:\/\/ss64.com\/bash\/\" style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Linux Bash Mac Terminal ... more ... thanks to http:\/\/ss64.com\/bash\/<\/p><\/div>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d331' onclick='var dv=document.getElementById(\"d331\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=60\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d331' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d2527' onclick='var dv=document.getElementById(\"d2527\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=60\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d2527' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial follows up on &#8230; Linux Bash Mac Terminal Tutorial. We delve more into the wonderful world of Linux and the command line with an approach of &#8220;doing some things&#8221;. With command line work it is easier to learn &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/more-linux-bash-mac-terminal-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,29,37],"tags":[132,234,327,707,723,1267,1319],"class_list":["post-2527","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-bash","tag-command-line","tag-did-you-know","tag-linux","tag-mac","tag-the-three-ps","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/2527"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=2527"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/2527\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=2527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=2527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=2527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}