{"id":39362,"date":"2017-01-03T15:19:31","date_gmt":"2017-01-03T21:19:31","guid":{"rendered":"https:\/\/eshop.macsales.com\/blog\/?p=39362"},"modified":"2017-01-04T15:52:57","modified_gmt":"2017-01-04T21:52:57","slug":"tech-101-introduction-to-the-macs-terminal-app-part-two","status":"publish","type":"post","link":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/","title":{"rendered":"Tech 101: Introduction to the Mac&#8217;s Terminal App, Part Two"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-29300\" src=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon.jpg\" alt=\"Terminalicon\" width=\"275\" height=\"263\" srcset=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon.jpg 360w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon-126x120.jpg 126w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon-284x271.jpg 284w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon-190x182.jpg 190w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon-126x120@2x.jpg 252w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/>Last week we kicked off our <a href=\"https:\/\/eshop.macsales.com\/blog\/39296-tech-101-introduction-to-the-macs-terminal-app-part-one\">Introduction to the Mac&#8217;s Terminal App<\/a> with a quick look at using and customizing Terminal, using the Bash shell to run a few commands; in our example, we used Terminal to modify the Mac&#8217;s Dock.<\/p>\n<p>In this installment we&#8217;ll delve deeper into the Bash shell, including creating a basic shell script, and looking at a few more commands to customize your Mac.<\/p>\n<p><strong>Login Scripts<\/strong><br \/>\nTerminal runs a set of scripts when a Bash shell is launched. By default, Bash shells in the Mac OS are of the login type, and run two specific scripts. The first is a system wide script that is run regardless of who is currently logged in. The second script is located at ~\/.bash_profile, and is run only for the specific logged-in user, and then only if a Bash shell is being started.<\/p>\n<p>There&#8217;s another set of scripts that are used when a non-interactive Bash script is run. These are scripts you create that begin with #! \/bin\/bash. This is the type of Bash shell script we mentioned that we would explore a bit later.<\/p>\n<p>Just like the login scripts, there&#8217;s a bashrc script that is system wide, and another at the user level, located at ~\/.bashrc.<\/p>\n<p>The bashrc script, as well as the login profile scripts, allows you to customize the Bash shell to meet your needs.<\/p>\n<figure id=\"attachment_39371\" aria-describedby=\"caption-attachment-39371\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-39371\" src=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280.jpg\" alt=\"(The shell's prompt can be customized to meet your needs. Here I've added a time stamp to my Bash shell prompt.)\" width=\"640\" height=\"322\" srcset=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280.jpg 1280w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280-239x120.jpg 239w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280-284x143.jpg 284w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280-190x96.jpg 190w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280-239x120@2x.jpg 478w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280-284x143@2x.jpg 568w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/CustomPrompt1280-190x96@2x.jpg 380w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-39371\" class=\"wp-caption-text\"><strong>(The shell&#8217;s prompt can be customized to meet your needs. Here I&#8217;ve added a time stamp to my Bash shell prompt.)<\/strong><\/figcaption><\/figure>\n<p><strong>Change Bash Shell Prompt<\/strong><br \/>\nOne of the first customizations of the Bash shell that is usually performed is to change the default shell prompt to something more personal. To do this we&#8217;ll use the script located at ~\/.bash_profile. We&#8217;ll add a command to the script that will change how the Bash shell prompt appears.<\/p>\n<p>The command we&#8217;ll insert is:<\/p>\n<p>PS1=&#8221; &#8221;<\/p>\n<p>Between the quotes is where the customization of the prompt occurs. You can use the following parameters (there are actually many <a href=\"http:\/\/ss64.com\/bash\/syntax-prompt.html\">prompt escapes<\/a> you can use, but these should be enough to get you started):<\/p>\n<p>\\d &#8211; Current date<\/p>\n<p>\\t &#8211; Current time<\/p>\n<p>\\h &#8211; Host name (your Mac&#8217;s name)<\/p>\n<p>\\# &#8211; Command number<\/p>\n<p>\\u &#8211; Logged-in user name<\/p>\n<p>\\W &#8211; Current working directory<\/p>\n<p>\\w &#8211; Current working directory with full pathname<\/p>\n<p>My custom prompt is PS1=&#8221;\\t \\h \\u \\W $ &#8220;. Note the space after the $ symbol; it&#8217;s not a requirement, but it adds a single character space between any command you type in Terminal and the $ prompt, for easier readability.<\/p>\n<p>Adding that line to the ~\/.bash_profile file can be done from Terminal, or with a <a href=\"https:\/\/eshop.macsales.com\/blog\/35192-friday-five-history-of-os-x-text-editors-which-you-should-use\">text editor<\/a>, such as <a href=\"https:\/\/itunes.apple.com\/us\/app\/textwrangler\/id404010395?mt=12\">TextWrangler<\/a>, an easy-to-use editor for coding. To add the PS1 command using Terminal and the built-in nano editor, try the following:<\/p>\n<figure id=\"attachment_39374\" aria-describedby=\"caption-attachment-39374\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-39374\" src=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280.jpg\" alt=\"(The nano editor opens within Terminal, and provides basic text editing functions.)\" width=\"640\" height=\"395\" srcset=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280.jpg 1280w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280-195x120.jpg 195w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280-284x175.jpg 284w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280-190x117.jpg 190w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280-364x225.jpg 364w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280-195x120@2x.jpg 390w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280-284x175@2x.jpg 568w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/NanoEditor1280-190x117@2x.jpg 380w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-39374\" class=\"wp-caption-text\"><strong>(The nano editor opens within Terminal, and provides basic text editing functions.)<\/strong><\/figcaption><\/figure>\n<p>Launch Terminal, located at \/Applications\/Utilities\/.<\/p>\n<p>At the Terminal prompt, enter the following:<\/p>\n<p>nano .bash_profile<\/p>\n<p>Press enter or return.<\/p>\n<p>The nano editor will open in Terminal. Enter the following, with no return or enter:<\/p>\n<p>PS1=&#8221;\\t \\h \\u \\W $ &#8221;<\/p>\n<p>Press Control + O. A dark banner will appear at the bottom of the nano editor, asking you to confirm that you wish to write the .bash_profile file. Press enter or return.<\/p>\n<p>Press Control + X to exit nano and return to Terminal.<\/p>\n<p>To see your new custom prompt, select Shell, New Window.<\/p>\n<p>A new Terminal window will open that will include your new custom prompt.<\/p>\n<p>There are many more ways to customize the Bash shell, but this is a good example to get you started.<\/p>\n<p><strong>Creating Bash Shell Scripts<\/strong><br \/>\nScripts have been a part of the Mac for ages. Your Mac comes equipped with multiple scripting systems, including AppleScript and Automator. The Bash shell can also run scripts. Bash shell scripts can be as simple as a series of commands you often use, or just about as complex as you can imagine.<\/p>\n<p><a href=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-39382\" src=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280.jpg\" alt=\"texteditscript1280\" width=\"640\" height=\"451\" srcset=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280.jpg 1280w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280-170x120.jpg 170w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280-284x200.jpg 284w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280-190x134.jpg 190w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280-170x120@2x.jpg 340w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280-284x200@2x.jpg 568w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/TextEditScript1280-190x134@2x.jpg 380w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Bash shell scripts are written in plain text and always begin with a shebang. A shebang is a two-character sequence that all shell scripts must start with. The pound sign (#) and exclamation point (!) together are called the shebang (#!). The shebang tells the shell that what follows the shebang is a directive instructing the computer what program interpreter to use, and that the rest of the lines following the shebang are a program to be run through the interpreter.<\/p>\n<p>Our script will look like this:<\/p>\n<p>#!\/bin\/bash<\/p>\n<p>First_Argument=$1<\/p>\n<p>Echo Hello world $First_Argument<\/p>\n<p>This is a pretty standard first scripting program. It takes a user-supplied variable (First_Argument=$1) and supplies it to the echo command, which will print out in Terminal Hello world, plus whatever the value of $First_Argument is.<\/p>\n<p>Let&#8217;s try it out.<\/p>\n<p>Launch TextEdit.<\/p>\n<p>Enter the script above into the document.<\/p>\n<p>Select Make Plain Text from the Format menu.<\/p>\n<p>Save the document as MyFirstScript in your home directory.<\/p>\n<p>Make sure the option &#8220;If no extension is provided use .txt&#8221; is unchecked.<\/p>\n<p>Click the Save button.<\/p>\n<p>The MyFirstScript file is just a plain text file at this point. To make it into a Bash shell script, it needs to be marked as an executable file. You do this by using the chmod command to change file permissions.<\/p>\n<p>In Terminal, make sure you&#8217;re in your home directory:<\/p>\n<p>cd ~<\/p>\n<p>chmod 700 MyFirstScript<\/p>\n<p>To try out the script, enter the following at the Terminal prompt:<\/p>\n<p>.\/MyFirstScript leaders<\/p>\n<p>The .\/ tells Bash the script is in the current directory, and the word leaders after the script name is the Argument you&#8217;re passing to the script.<\/p>\n<p>You should see Terminal respond with:<\/p>\n<p>Hello world leaders<\/p>\n<p><strong>Terminal Command Tips<\/strong><br \/>\nTerminal and Bash have some nifty tricks for reducing the amount of typing you need to perform. Two of our favorite tricks are:<\/p>\n<figure id=\"attachment_39370\" aria-describedby=\"caption-attachment-39370\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-39370\" src=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280.jpg\" alt=\"(The history command will display past shell commands, numbered in the order you used them. Check the bonus tip for how you can use history.)\" width=\"640\" height=\"420\" srcset=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280.jpg 1280w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280-183x120.jpg 183w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280-284x186.jpg 284w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280-190x125.jpg 190w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280-100x65.jpg 100w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280-183x120@2x.jpg 366w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280-284x186@2x.jpg 568w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/BashHistory1280-190x125@2x.jpg 380w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-39370\" class=\"wp-caption-text\"><strong>(The history command will display past shell commands, numbered in the order you used them. Check the bonus tip for how you can use history.)<\/strong><\/figcaption><\/figure>\n<p>Up arrow: Repeats the last command you entered. You can use the up arrow multiple times to go back through the history of commands. This way, you can redo any command that&#8217;s in the Terminal history file without having to type it back in.<\/p>\n<p>history: The history command will display all the commands you&#8217;ve run. If you provide a number after history, you can display the last x number of commands. <em>Bonus tip:<\/em> Command history includes numbers. If you want to rerun command number 4, enter !4 at the prompt.<\/p>\n<p><strong>Mac OS Defaults<\/strong><br \/>\nOne of the uses of Terminal and the Bash shell is to read or write an app&#8217;s preference settings. Many times apps have preferences that aren&#8217;t available via the standard GUI interface.<\/p>\n<p>To finish off our introduction to Terminal, we&#8217;re going to end with some of our favorite <a href=\"https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/man1\/defaults.1.html\">defaults commands<\/a> to customize your Mac.<\/p>\n<figure id=\"attachment_39372\" aria-describedby=\"caption-attachment-39372\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-39372\" src=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280.jpg\" alt=\"(Terminal can be used to set the Save or Save As dialog boxes to open in the expanded state, making it easier to browse through the file system.)\" width=\"640\" height=\"348\" srcset=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280.jpg 1280w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280-221x120.jpg 221w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280-284x154.jpg 284w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280-190x103.jpg 190w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280-221x120@2x.jpg 442w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280-284x154@2x.jpg 568w, https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2017\/01\/ExpandedSaveDialog1280-190x103@2x.jpg 380w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-39372\" class=\"wp-caption-text\"><strong>(Terminal can be used to set the Save or Save As dialog boxes to open in the expanded state, making it easier to browse through the file system.)<\/strong><\/figcaption><\/figure>\n<p><strong>Expand Save Panels<\/strong><br \/>\nExecute the following command in Terminal to force the Save panel to always show the expanded view:<\/p>\n<p>defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true<\/p>\n<p>To undo, use:<\/p>\n<p>defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool false<\/p>\n<p><strong>Display Hidden Files<\/strong><\/p>\n<p>The Mac OS hides some files from the user. This command will make them visible in the Finder.<\/p>\n<p>defaults write com.apple.finder AppleShowAllFiles TRUE<\/p>\n<p>Press enter or return.<\/p>\n<p>Killall Finder<\/p>\n<p>Press enter or return.<\/p>\n<p>To undo, use:<\/p>\n<p>defaults write com.apple.finder AppleShowAllFiles FALSE<\/p>\n<p>Press enter or return.<\/p>\n<p>Killall Finder<\/p>\n<p>Press enter or return.<\/p>\n<p><strong>Add a Login Message<\/strong><br \/>\nIf you have your Mac configured to require a login on startup, then this command will let you add a message to the login window.<\/p>\n<p>sudo defaults write \/Library\/Preferences\/com.apple.loginwindow LoginwindowText &#8220;Your login window message text goes here&#8221;<\/p>\n<p>Press return or enter.<\/p>\n<p>You&#8217;ll be asked for an administrator&#8217;s password.<\/p>\n<p>Press return or enter.<\/p>\n<p><strong>Resources<\/strong><br \/>\nFor additional Terminal and Bash resources, check out the following:<\/p>\n<ul>\n<li><a href=\"http:\/\/ss64.com\/osx\/\">An A-Z Index of Apple OS X Terminal Commands<\/a><\/li>\n<li><a href=\"https:\/\/developer.apple.com\/legacy\/library\/documentation\/Darwin\/Reference\/ManPages\/\">Mac OS X Manual Pages<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Last week we kicked off our Introduction to the Mac&#8217;s Terminal App with a quick look at using and customizing Terminal, using the Bash shell to run a few commands; in our example, we used Terminal to modify the Mac&#8217;s Dock. In this installment we&#8217;ll delve deeper into the Bash shell, including creating a basic [&hellip;]<\/p>\n","protected":false},"author":97,"featured_media":29300,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":"","footnotes":""},"categories":[4],"class_list":["post-39362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-tips"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.2 (Yoast SEO v20.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tech 101: Introduction to the Mac&#039;s Terminal App, Part Two<\/title>\n<meta name=\"description\" content=\"Last week we kicked off our Introduction to the Mac&#039;s Terminal App with a quick look at using and customizing Terminal, using the Bash shell to run a few\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tech 101: Introduction to the Mac&#039;s Terminal App, Part Two\" \/>\n<meta property=\"og:description\" content=\"Last week we kicked off our Introduction to the Mac&#039;s Terminal App with a quick look at using and customizing Terminal, using the Bash shell to run a few\" \/>\n<meta property=\"og:url\" content=\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/\" \/>\n<meta property=\"og:site_name\" content=\"Rocket Yard\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-03T21:19:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-01-04T21:52:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"360\" \/>\n\t<meta property=\"og:image:height\" content=\"344\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tom Nelson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Nelson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/\"},\"author\":{\"name\":\"Tom Nelson\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#\/schema\/person\/647f465acd469444183711d2a22648cb\"},\"headline\":\"Tech 101: Introduction to the Mac&#8217;s Terminal App, Part Two\",\"datePublished\":\"2017-01-03T21:19:31+00:00\",\"dateModified\":\"2017-01-04T21:52:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/\"},\"wordCount\":1398,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#organization\"},\"keywords\":[\"Apple\",\"Bash\",\"defaults\",\"Mac\",\"Mac OS\",\"macOS\",\"OS X\",\"Scripting\",\"Shell\",\"Terminal\",\"UNIX\"],\"articleSection\":[\"Tech Tips\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/\",\"url\":\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/\",\"name\":\"Tech 101: Introduction to the Mac's Terminal App, Part Two\",\"isPartOf\":{\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#website\"},\"datePublished\":\"2017-01-03T21:19:31+00:00\",\"dateModified\":\"2017-01-04T21:52:57+00:00\",\"description\":\"Last week we kicked off our Introduction to the Mac's Terminal App with a quick look at using and customizing Terminal, using the Bash shell to run a few\",\"breadcrumb\":{\"@id\":\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/eshop.macsales.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tech 101: Introduction to the Mac&#8217;s Terminal App, Part Two\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#website\",\"url\":\"https:\/\/eshop.macsales.com\/blog\/\",\"name\":\"Rocket Yard\",\"description\":\"Your source for expert tips, special deals, commentary, reviews, and the latest tech news.\",\"publisher\":{\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/eshop.macsales.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#organization\",\"name\":\"OWC\",\"url\":\"https:\/\/eshop.macsales.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2020\/06\/rocket-yard-logo-round.png\",\"contentUrl\":\"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2020\/06\/rocket-yard-logo-round.png\",\"width\":1024,\"height\":1024,\"caption\":\"OWC\"},\"image\":{\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#\/schema\/person\/647f465acd469444183711d2a22648cb\",\"name\":\"Tom Nelson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eshop.macsales.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cb537829ec9582eb81bd2dcf5c7e88d981ed66bd6f65dd36508faf46d38ba5a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cb537829ec9582eb81bd2dcf5c7e88d981ed66bd6f65dd36508faf46d38ba5a9?s=96&d=mm&r=g\",\"caption\":\"Tom Nelson\"},\"description\":\"Tom has been an enthusiastic Mac user since the Mac Plus. He\u2019s also been known to dabble in the dark side, otherwise known as Windows, and has a well-deserved reputation for being able to explain almost anything to anybody. Tom\u2019s background includes more than 30 years as an engineer, programmer, network manager, software tester, software reviewer, database designer, and computer network and systems designer. His online experience includes working as a sysop, forum leader, writer, and software library manager.\",\"sameAs\":[\"http:\/\/rocketyard.com\"],\"url\":\"https:\/\/eshop.macsales.com\/blog\/author\/tom-n\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Tech 101: Introduction to the Mac's Terminal App, Part Two","description":"Last week we kicked off our Introduction to the Mac's Terminal App with a quick look at using and customizing Terminal, using the Bash shell to run a few","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:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/","og_locale":"en_US","og_type":"article","og_title":"Tech 101: Introduction to the Mac's Terminal App, Part Two","og_description":"Last week we kicked off our Introduction to the Mac's Terminal App with a quick look at using and customizing Terminal, using the Bash shell to run a few","og_url":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/","og_site_name":"Rocket Yard","article_published_time":"2017-01-03T21:19:31+00:00","article_modified_time":"2017-01-04T21:52:57+00:00","og_image":[{"width":360,"height":344,"url":"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon.jpg","type":"image\/jpeg"}],"author":"Tom Nelson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom Nelson","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#article","isPartOf":{"@id":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/"},"author":{"name":"Tom Nelson","@id":"https:\/\/eshop.macsales.com\/blog\/#\/schema\/person\/647f465acd469444183711d2a22648cb"},"headline":"Tech 101: Introduction to the Mac&#8217;s Terminal App, Part Two","datePublished":"2017-01-03T21:19:31+00:00","dateModified":"2017-01-04T21:52:57+00:00","mainEntityOfPage":{"@id":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/"},"wordCount":1398,"commentCount":2,"publisher":{"@id":"https:\/\/eshop.macsales.com\/blog\/#organization"},"keywords":["Apple","Bash","defaults","Mac","Mac OS","macOS","OS X","Scripting","Shell","Terminal","UNIX"],"articleSection":["Tech Tips"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/","url":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/","name":"Tech 101: Introduction to the Mac's Terminal App, Part Two","isPartOf":{"@id":"https:\/\/eshop.macsales.com\/blog\/#website"},"datePublished":"2017-01-03T21:19:31+00:00","dateModified":"2017-01-04T21:52:57+00:00","description":"Last week we kicked off our Introduction to the Mac's Terminal App with a quick look at using and customizing Terminal, using the Bash shell to run a few","breadcrumb":{"@id":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/eshop.macsales.com\/blog\/39362-tech-101-introduction-to-the-macs-terminal-app-part-two\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eshop.macsales.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tech 101: Introduction to the Mac&#8217;s Terminal App, Part Two"}]},{"@type":"WebSite","@id":"https:\/\/eshop.macsales.com\/blog\/#website","url":"https:\/\/eshop.macsales.com\/blog\/","name":"Rocket Yard","description":"Your source for expert tips, special deals, commentary, reviews, and the latest tech news.","publisher":{"@id":"https:\/\/eshop.macsales.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/eshop.macsales.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/eshop.macsales.com\/blog\/#organization","name":"OWC","url":"https:\/\/eshop.macsales.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eshop.macsales.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2020\/06\/rocket-yard-logo-round.png","contentUrl":"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2020\/06\/rocket-yard-logo-round.png","width":1024,"height":1024,"caption":"OWC"},"image":{"@id":"https:\/\/eshop.macsales.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/eshop.macsales.com\/blog\/#\/schema\/person\/647f465acd469444183711d2a22648cb","name":"Tom Nelson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eshop.macsales.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cb537829ec9582eb81bd2dcf5c7e88d981ed66bd6f65dd36508faf46d38ba5a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb537829ec9582eb81bd2dcf5c7e88d981ed66bd6f65dd36508faf46d38ba5a9?s=96&d=mm&r=g","caption":"Tom Nelson"},"description":"Tom has been an enthusiastic Mac user since the Mac Plus. He\u2019s also been known to dabble in the dark side, otherwise known as Windows, and has a well-deserved reputation for being able to explain almost anything to anybody. Tom\u2019s background includes more than 30 years as an engineer, programmer, network manager, software tester, software reviewer, database designer, and computer network and systems designer. His online experience includes working as a sysop, forum leader, writer, and software library manager.","sameAs":["http:\/\/rocketyard.com"],"url":"https:\/\/eshop.macsales.com\/blog\/author\/tom-n\/"}]}},"jetpack_featured_media_url":"https:\/\/eshop.macsales.com\/blog\/wp-content\/uploads\/2015\/03\/Terminalicon.jpg","jetpack_shortlink":"https:\/\/wp.me\/pmPaT-aeS","_links":{"self":[{"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/posts\/39362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/users\/97"}],"replies":[{"embeddable":true,"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/comments?post=39362"}],"version-history":[{"count":4,"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/posts\/39362\/revisions"}],"predecessor-version":[{"id":39383,"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/posts\/39362\/revisions\/39383"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/media\/29300"}],"wp:attachment":[{"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/media?parent=39362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eshop.macsales.com\/blog\/wp-json\/wp\/v2\/categories?post=39362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}