Isolationism is deeply rooted in American history. As Selig Adler, the pro-interventionist historian once pointed out, quote, the American revolution was in itself an act of isolation for it cut the umbilical cord to the mother country, end quote. Prior to the annexation of Hawaii and the Spanish-American war, it simply did not occur to anyone that an American empire was either possible or desirable. There was no anti-interventionist movement in America before the late 1800s for the simple reason that a marked aversion to foreign adventurism was well nigh universal. The idea that we ought to keep aloof from the world was not just the political or ideological principle of held by all parties and factions. It was a cultural trait, part of what it meant to be an American. Isolationism was not the policy of a particular party or movement, the anti-imperialist movement, but the cultural consensus and deeply held conviction of Americans at every social level. We were different. Unlike the Europeans, we did not go marauding about in search of trouble, treasure, and trade concessions. Interventionism was a policy of kings and emperors, not of free Republican governments. Seemingly inoculated against the European vice of foreign adventurism, we were almost, almost never tempted to indulge until February 3, 1893. On that day, a curious delegation appeared in the city of San Francisco. Arriving on the steamer Claudine, the five-man delegation represented a conspiracy of white planters who would seize the island of Hawaii, depose Queen Lillio Colani, and now sought to incorporate the islands into the first American outpost of empire. What one congressional opponent of annexation would later call the bacillus of imperialism had finally touched US soil. Now, the annexationists pressed their case in terms of the alleged economic and military benefits to American business. Hawaii, it was said, is the gateway to the markets of the Orient. The opponents of annexation, southern Democrats and northern Mugwumps, saw the conquest of the Hawaiian Kingdom as the first breach in the walls of the American Republic, and so it was. The country in possession for the first time of a colonial empire would be no different from the imperial powers of Europe. Now, one such anti-imperialist was the Mugwump Carl Scherrs, editor of the influential Harper's Weekly. He made the same arguments against the annexation of Hawaii as he made against President Grant's ill-fated attempt to grab Santo Domingo. Scherrs had argued that we could not absorb Santo Domingo and survive as a republic. For the United States could never rule other peoples by sheer force without doing violence to itself and fundamentally altering its own nature. If Santo Domingo were to be annexed, it therefore followed that it must be admitted as a state, a full-fledged part of the Union, right up there with Massachusetts and Indiana. But this, he averred, was impossible, since no republic had ever flourished beneath a tropical sun. To annex, the American tropics would be to acquire no end of trouble. Quote, have you thought of what this means? He asked. Fancy 10 or 12 tropical states added to the southern states we already possess. Fancy the senators and representatives of 10 or 12 millions of tropical people. Fancy them sitting in the halls of Congress, throwing the weight of their intelligence, their morality, their political notions and habits, their prejudices and passions into the scale of the destinies of this republic. He goes on to denounce, quote, a singular delusion that has taken hold of the minds of otherwise clear-headed men. It is that our new friendship with England would serve firmly to secure the world's peace, end quote. Now, this suspicion of Britain's baneful influence is a theme that started in Jefferson's day and resurfaced again during the debate over what to do with the spoils of the Spanish-American war. Speaking against the annexation bill, Senator Bland of Georgia declared, quote, the secret reason for this bill, he said, was to, quote, pressure on the part of Great Britain. Isolated yet possessed of a vast empire, Great Britain needed allies, really subordinates, to do her bidding and had settled on the United States to play this role. Dependent on England to hold our Asiatic territory, the Democratic senator feared we would be pulled into a dispute over the division of a Chinese spoils. In the senator's opinion, he could not, quote, but regard annexation as a deeply laid scheme to enslave the American people under the present domination of plutocracy. The power of the Bank of England, the wealth of that country over the banks and moneyed institutions of this country has brought to bear the combined power of the capitalists of England and America to control our financial system. The next move is to put our army and navy at the service of England in the prosecution of Asiatic conquest, the end of which no man can see. And so, summing up this period, we have three major anti-imperialist themes, three arguments against the rise of empire. One, the ideological argument. In this view, imperialism is seen as a direct threat to Republican institutions. The idea that we could rule people without their consent violated our own anti-colonialist heritage. Furthermore, the decision to set up a course for empire would inevitably mean a huge standing army, huge public debts, and the threat to American liberties represented by both of these dire prospects. In the process of acquiring an empire, we would lose our distinctively American character and wind up just like the decadent empires of Europe.  We had already fought one civil war over the question of race. The addition of yet more cultural diversity would add the possibility of yet more racial strife. Apart from the ethnic angle, however, there was a more significant point to be made, that the policy of imperialism would so degrade and contaminate American culture that the very character of the people would be altered and corrupted almost beyond redemption. Three, the conspiratorial argument couched in populist rhetoric that imperialism was a policy of a plutocratic elite of the munitions makers and the bankers with their foreign loans, who made money off the human slaughter. Furthermore, so went the argument, this plutocracy was so enamored of Great Britain that it was willing to sacrifice our Republican heritage and the national interest in playing out the role assigned to us by London. Now, the isolationist reaction to expansionism included elements of both parties. Both major factions of a democratic party, Brianites and Cleveland Democrats, were generally opposed to the policy of imperialism. On the Republican side, the Taft Republicans as in William Howard Taft, as in William Howard Taft, excuse me, and the Roosevelt bull moosters were pro expansionist, while the so-called Mugwumps, many of whom were among the founders of the Republican party, made up an important part of the emerging anti-imperialist coalition. The fight over the annexation issue also brought out regional divisions and these were exacerbated by the debate. Opposition to imperialism was centered in the south and the Midwest, with important pockets of organized anti-imperialist activity throughout New England, that bastion of Mugwumpery. In the Midwest, this regionalism was associated with a healthy Jeffersonian hatred of the Eastern financial establishment. Now, in a broad sense, what made possible the victory of the empire builders and the overthrow of the old isolationist mindset, at least among the urban intellectuals in the policymaking league, was the political culture of progressivism. This included a wide variety of cultural uplifters, abolitionists, feminists, prohibitionists, millenarian fundamentalists, as Murray pointed out in his excellent talk last night, militant vegetarians, and of course, professional intellectuals of every size, shape, and description, eager to try out their endless schemes for the improvement and uplifting of mankind. It was only natural that these people, having set their sights on saving the nation, would feel compelled to take on the rest of the world. This crusading spirit and America's acquisition of overseas colonial empire planted the seeds that would sprout a crop of myrmidons on the eve of the First World War. Now, the coming of the Great War gave birth to an anti-interventionist movement colored with the traditional themes of American anti-imperialism. As Europe sank into a chaos of blood-drenched darkness, Teddy Roosevelt, Henry Cabot Lodge, and former Secretary of War, Henry L. Stimson, launched a campaign to reunite the Republicans and the progressives over the preparedness issue. President Wilson soon came up with his own proposals to increase military appropriations as he inched closer to a decision to go to war. The anti-interventionists struck back when the House of Representatives nearly succeeded in eliminating the ambitious proposal of a Navy to increase the number of battleships. An amendment to cut the naval appropriation in half failed by a mere 16 votes, and the battle lines were drawn. Of the 155 votes cast in favor, the majority were Southern and Midwestern Democrats. Now, the agrarian Jeffersonian wing of a Democratic Party abhorred the rise of a professional military cast, fearing that it would threaten democracy and pressionize the Republic. Midwestern Democrats like Representative Clyde Taverner of Illinois denounced the war trust, quote unquote, which had cornered the market in international strife. Georgia populous Tom Watson declared that the real enemy was not abroad, but here at home in the class legislation of, quote, overgrown and insolent monopolies. Now, traditional Democratic opposition to militarism and big military budgets was muted, however, by the fact that they were, after all, the party in power and thus reluctant to oppose President Wilson's armaments program. While there was a hardcore of anti-preparedness Democrats in the House and Senate, their numbers dwindled as the pressures of party politics were brought to bear. On the Republican side, 15 voted for the cut in naval appropriations, including 13 Midwesterners, most of whom were progressives. This Republican insurgency represented a significant shift. For years, many of these same people had gone along with imperialism and voted for a greatly enhanced Army and Navy, especially during the era of Teddy Roosevelt. Under the pressure of events, however, many leading progressive Republican legislators came around to the opposite point of view and you see this happening today and you see it happening over and over in history and we'll get to that. Representative James L. Sladen, a Texas Democrat, declared, but he suspected, quote, a conspiracy to force our country into war with Germany. He attacks a great and influential lobby operating about the halls of Congress and the press, whose purpose is not only to feed the maw of the munitions makers, but also to deploy our enlarged forces in Europe. The people he contended must be mobilized against, quote, the majority of the newspapers and great commercial interests, end quote. So we see that nothing ever really changes. Here Sladen is expressing the main theme of anti-imperialism, first raised in the battle against annexation of Hawaii and the Philippines and now amplified and applied to Wilson's military buildup and his handling of the submarine crisis, a war-mongering and profiteering elite motivated by greed and a treasonous devotion to Great Britain was conspiring to involve us in the intrigues of Europe and get us into the war. This concept, first articulated by the anti-imperialist movement of the 1890s, was a favorite populist theme that developed and grew stronger with the years, carrying over into the isolationist resistance to World War I and World War II and permeating the rhetoric of non-interventionist factions within both parties. Now, at about this time, there came into existence the first internationalist organization in American history with the rather ominous name of the League to Enforce Peace. President Howard Taft, William Howard Taft, served as chairman and the League was the creature of the internationally-minded Taft Republicans, that is the party of Eastern finance capital. It was not some fringe group of fuzzy-minded radical pacifists but the big business establishment itself that was sponsoring and propagandizing the most wide-ranging scheme of international organization yet devised. The League wanted to set up an international council of conciliation, which would hear all disputes between nations and force would be used against so-called outlaw nations who refused to submit. William Jennings Bryan denounced the League plan and Randolph Bourne, the young hunchback radical and literary avenging angel of pre-war liberalism, described it as, quote, an alliance of all against each that practically ensures that every war within the system would be a world war. This debate over the merits of internationalism had no effect on the 1916 election. As happened so often in US history, it was a bipartisan internationalism that faced the voters that fateful presidential election year. The Republican nominee was Charles Evans Hughes, sounding very much like his friends in the League to enforce peace and foreign policy played almost no role in the campaign. It wasn't until after Wilson's election victory but the controversy started to heat up again. At a banquet given by the Democratic National Committee in honor of William Jennings Bryan, the guest of honor denounced any thought of, quote, our being an international policeman, unquote, and called for a constitutional amendment requiring the submission of every declaration of war to a referendum of the people, except in case of actual invasion of our country. Now, this is a theme that recurs over and over again. During the Second World War, there was the Ludlow Amendment, the Heroic Ludlow Amendment, and even today there is now a movement, though I guess it's mostly on the left, to do the same thing. Senator William E. Bora, Republican of Idaho, who had sometimes gone along with the preparedness campaign, charged with the president's League of Nations, represented a scheme that would drag this country into endless foreign wars. We were headed, warned the senator, into the storm center of European politics. The League of Nations proposal solidified the progressive Republican response to Wilsonian internationalism, and pretended a shift in the alignment of the two parties in the realm of foreign policy. From this time until the Cold War, the Republicans moved toward isolationism and the Democrats moved increasingly toward interventionism, reversing their historic roles. Now, there were, of course, exceptions, Taft and his followers remained internationalists, and Teddy Roosevelt and Lodge also were in favor of maintaining our international alliances, but these leaders came more and more to be in a minority in their own parties. As a new republic editorial put it, what had been the party of jingoism and imperial overstretch was now proposing, quote, to crouch at its own fireside, build a high tariff wall, arm against the whole world, cultivate no friendships, take no steps to forestall another great war, and then let things rip. The party, which was once inspired by the American Union, is becoming the party of secession and state's rights as against world union, quote, unquote, and I'm in favor of it. Among the Democrats, the party regulars were forsaking their traditional fealty to the foreign policy of Thomas Jefferson and uniting around President Wilson's internationalist program. While some Democrats spoke out in defense of the old program, opposition from the Brian wing was muted as was Brian himself. Now, the vote in the House of Representatives on the war resolution reflected the politics of the emerging isolationist coalition, which would retain its essential character for the next 40 years. During that debate, isolationist themes were reiterated with renewed vigor. In entering the war, we would hand the victory to the money-mad profiteers who trafficked in arms. In spreading democracy and peace abroad, we would lose it at home. In saving the Europeans, we would lose our own souls. 54 congressmen voted against Wilson's war, 35 Republicans, 18 Democrats, and one socialist. Although there were a few conservative Republicans who voted no, most were left-wing populists of the Lafayette variety, midwesterners who hated bigness, the Eastern establishment, and the government business partnership that was the basis of the state capitalist order. Virtually all the Democrats who voted no were Southern Brianites who remembered their party's historical antipathy to war, militarism, and overseas adventurism. Now, in the opposition to the First World War, the three themes of the anti-interventionist movement were amplified and developed. The ideological argument was reflected in the progressive critique of war as the policy of a ruthless elite that profits from a slaughter. The Republic had been overthrown by such men and the populist progressives meant to take it back. After the Great War, the cultural and conspiratorial themes tended to merge into a single argument that foreign lobbyists and government and the media exert a decisive influence in the councils of power. Now, historical revisionism played a key role. Harry Elmer Barn's books, The Agenesis of the World War and In Quests of Truth and Justice gave voice to the universal mood of disillusionment. Barn's critique of US intervention in the Great War was preceded by and thematically quite similar to the work of Judge Frederick Bausman, author of Led France Explained. Bausman had retired from the Washington State Supreme Court and devoted himself to writing the first American book to expose the myth of German war guilt. Writing in H. L. Menken's American Mercury, Bausman asked, was ever a country so bedeviled as ours? Has there ever been one in all history in which the class most powerful and controlling government and public opinion was determinedly bent on giving away enormous sums of the country's money to nations already heavily armed and openly expressing contempt for our sacrifice, which they would accept only as their due. It is an actual fact, but in many circles of wealth and fashion in this country, one who takes his country's side in these debates is put to shame at dinner tables, end quote. Well, it all depended on whose dinner table you ate at. In the East among maturi-loving would-be aristocrats of American society, this was no doubt true. But in the Midwest, a new Americanism was brewing. The general disillusionment that follows any war combined with popular resentment against British wartime propaganda and their attempt to get out of paying their war debts to the United States reached the boiling point in the late 20s. A wave of anti-British feeling swept the country and a coalition of groups, such as the Veterans of Foreign Wars and the Patriotic League for the Preservation of American History joined forces to get rid of the anglophilic bias in the nation's schoolbooks. The Veterans of Foreign Wars declared at that time that quote, the heroic history of a nation is the drum and fife music to which it marches. It makes a mighty difference whether America continues to quick-step to Yankee Doodle or takes the marking time to God save the king. Now, this was a mass movement. Of course, today this is almost inconceivable, but perhaps not. In October 1927, Bausman testified in the celebrated case of William McAndrew, the superintendent of schools in Chicago, who had been suspended for authorizing blatantly pro-British textbooks with an explicitly internationalist bias. Initiated by Chicago mayor, Big Bill Thompson and his advisor pro-American journalist and author, Charles Grant Miller, the campaign to decolonize and reclaim the history of his country was given voice in Bausman's testimony. England, he said, had quote, beguiled us into war, took all the spoils of it and did not want to pay her debts, end quote. The inculcation of American youth with a treasonous reverence for the so-called mother country was the work of quote, financiers of England who seek first the full cancellation of England's war debt to the United States and second the placing of the Union Jack wherever now flies the stars and stripes, end quote. Now, the trumpet of this mid-western isolationism of the right was Colonel Robert Rutherford McCormick's Chicago Tribune newspaper, the flagship newspaper of the McCormick Medal and Patterson newspaper chain. McCormick regularly excoriated our deadbeat so-called allies for welching on their war debts and castigated the State Department for toting up to the British. Another editorial voice raised against internationalism was that of George Horace Lorimer, founding editor of a Saturday Evening Post. Liberals disillusioned by the Treaty of Versailles Midwestern progressives wary of a foreign interventionism and economic centralism and conservative Republicans who hated FDR and all his works. This was the broad-based coalition that coalesced into the movement we know today as the old right. Forge in the battle against the New Deal and Franklin Delano Roosevelt's drive to war, the old right coalition transformed the Midwestern progressive Republicans who had initially supported the New Deal into the bitterest Roosevelt haters in the country and principled opponents eventually of big government. Their evolution is encapsulated in the career of the writer and publicist, John T. Flynn who started out as a new republic liberal and opponent of big business monopolism and became the outstanding organizer and spokesman for the America First Committee and the old right conservatives. In Flynn's mind, opposition to centralism and militarism were the main targets, were the main tenants of the liberal creed. And in his campaign against the New Deal and the war, he was merely being consistent. But in fact, there was a change in the analysis of the old fashioned liberals, a clarification of their previously confused economic views. They became opponents of big government. Yesterday's critics of capitalism were transformed like Flynn into advocates of free enterprise and strictly limited government. In the old right, in the America First Committee, all the main currents of anti-interventionism, populism, progressivism, nationalism, libertarianism merged into a single movement in opposition to the New Deal and the war. Out of this popular front, the modern conservative movement was born. Now, I've already dealt with this subject in my book, Reclaiming the American Right, the Lost Legacy of the Conservative Movement.  And I refer you to that work for an extensive treatment of the subject. Suffice to say that the old right is sort of hovering over this room, watching us. And they are intellectual ancestors. They are a heritage. And I encourage you to investigate the history of the old right. Now, those who oppose the transformation of our American Republic into an empire hailed from both ends of the political spectrum, from far right to far left and virtually all points in between. From the free silver populism of William Jennings Bryan to the old right laissez-faire-ism of Garrett Garrett, the various strands of non-interventionist thought are made of distinct and diverse fibers. The history of the anti-interventionist movement is the story of how those disparate threads have been slowly woven together over time. It is the story of a developing Americanism, of an American ideology that encompasses not only foreign but domestic policy, of a libertarian nationalism that extols America as the fatherland of liberty. The evolution of this ideology is an ongoing process of which this historic conference is a vitally important part. Thank you.


Dwayne McDaniel. Dwayne first started using Drupal and WordPress for the San Francisco Improv community in 2013, which led him to his current role. As a developer advocate at Pantheon, he has had the privilege of presenting at dozens of community events, from Paris to Iceland and from MIT to Stanford. Dwayne McDaniel. Awesome intro. Thank you very, very much for that. Says I was just introduced. Now I feel redundant. I'm Dwayne. How you're going to get the most out of this talk is you're going to go to mcdwayne.com and find the slides of this talk and just pull it up on your machine. If you're playing along at home, that's awesome. I'll talk more about how you're going to get more later, but if you ever want to talk about crocheting or web comics or karaoke like the awesome party tonight, we're going to sing good. I'm always happy to talk about those things. There's how to get a hold of me. Twitter is my social media of choice. I think it's the best social media thing ever made for events and I get a lot of events and if you go to my website, you'll see that. Quick plug for the company I work for that sends me here. This is Pantheon. Who in the room is familiar with Pantheon? That's about half the room. We are a website operations platform, a way to build and run your websites no matter how big your team is, no matter how complex your workflow gets. We're there for you. We post some of the biggest, most complex sites in the world and probably work with you. So quick pull time. Actually, actually, if I get everybody that's comfortable standing up right now to just stand up real quick and let's practice raising our arms. Everybody just raises our arms up as high as you feel comfortable doing it. If you don't push it, all right. Now put your arms down and look to your left and right and see if you know those people. If you don't introduce yourself real quick, take like 30 seconds. Hi, man, I'm Dwayne. Nice to meet you. Thanks. Thanks for coming up. All right, I got to get back to the room but thank you very much. All right, now we're together in a room doing a thing together. Good job. If you haven't met those people, talk to them later. It'll be plenty of time. Who saw this on the schedule and said, I want to go to that talk. That's half the room paying attention. Who in the room has a computer? Again, the same people don't raise their hand, they weren't paying attention. They have a computer open in front of them. Who here is a full-time developer? What they do is they consider themselves a developer. Awesome, you're going to get a lot out of this talk. Who here is a full-time designer and what they do is design? Awesome, raise your hand proudly. All the developers look around and see the designers because you really need their help. Really bad. Other way around, true. Any project managers in here? Yes, project managers rule. Is there any business people? They're business people. That's what they do. Awesome. Is there any other fields that I left out, any other things like things of note? Chugglers. Anyone else? Okay. Well, I hope all you get out of it. Does anybody in here create content on the regular? Ultimately, I think this will help you at the end of the day. That's going to be a while before we get there in this talk. I have a lot of slides and I'm not cutting them down for this talk and not for you guys. If you want to do this as a tutorial as a go on your own pace workshop, that's what I really built. I'm going to go through highlights today. I'm going to read every slide to you. If you don't know what bash is, don't worry about it. Just take some notes. Just pay attention and get some ideas. If you were using bash on the reg or casually just here and there and you copy, paste things into bash and you're not really sure what you're doing, maybe open your machine and play along when we get to the tutorial parts. If you can understand what that last line is, just go do that and we'll get there later because there's something in this talk for everyone. I call this talk bash is magic. No, it's not for a reason. We'll get to the no, it's not part later. But bash seems like magic. It's this amazing thing. Let's talk about magic for a second. Magic is exciting. It's kids birthday parties. It's card tricks. It's pen and teller. It's awesome, fun stuff. But it's also potentially really dangerous and confusing and black magic and just feels weird. And if you don't know what you're doing with it, this seems overwhelming and there's a lot to read here and there's a lot to think about. How would you even use this card? It's an awesome card, by the way. But I really want to demystify this. When I was talking to one of my business colleagues and I was trying to write this talk in the first place, I got stuck at a point and I was just bouncing ideas off then and he's like, you know, that sounds like kind of the whole point of open sources, isn't it? Like just tie in smart things together that other smart people made. And I'm like, that's really really an insight, Ben. So I put it in my talk. Because if we have all these open source tools that we can use and we can know what to do with them, they're not scary. But anything we don't know, the unknown, is always terrifying. Especially when you hear of stories like this, which isn't even a true story. It just got publicized. That we can do things that are just crazy powerful that can wipe out entire racks of servers with one bad command, which is technically possible, but this is actually a made up story. But ultimately we're all afraid of touching one wrong thing on our machine and doing this. But that real fear isn't that we're going to mess up a machine. It's a machine. Who cares? We're going to do another machine and move on. But it took us so long to get that machine set up the way we wanted it. It took us so long to figure out all the ins and outs of all the GUI screens for that operating system. Sometimes it takes years to get a machine to do exactly what you want it to do. And this fear is very, very, very real. But I'm here to tell you today, don't be afraid of it. I'm not the person that was going to tell you don't be afraid of it. There's a lot of people in the universe that will tell you don't be afraid of bash. If you have no idea what it is, don't worry about it. We'll get there. But it's not something to be terrified of. It is something that's going to unleash the power of your machine in a way that you can't do today. My center premise is this. Why do you want to do this? Because we live in a world behind graphical user interfaces. And there's nothing wrong with GUIs. GUIs make our lives easier. That we don't have to think about what to type to invoke a command. We can simply go click a button and do a thing. And that makes life great on Chrome. And if you're watching YouTube and a lot of other things, it's just easy. But what you're really living behind is what a developer thought you should do with your machine. Which is a very limited scope. Because they, as a developer working on a project or a designer, want you to do this set of actions in this order. And the GUI reflects that. There's nothing wrong with that. But this is also slow. Going through and setting up a WordPress website by hand is slow. Especially if you do it a lot. If you find yourself doing the same thing repeatedly over and over again every day, it turns out there's a better way to do that. You can automate anything that you can do repeatedly with the same repeatable steps if you tell a machine just to do those same steps. That's really hard to do with a GUI. Things like Zapier and if-then-then-that make that a little easier on a certain scale. But you can extend that to literally anything your machine can do. But just telling the machine what to do. And if you do development long enough, or you're in the space long enough, eventually you will run into a problem where someone will say, hey, there's already a really good tool that solves that.  And if you don't know what GitHub is and you don't know how to use these command line tools, it's like they're speaking in alien language from outer space. And like, I don't know. And you show up and like, I don't know what to do with any of this because it's not documented well. And ultimately, we know that we can tell machines to do very complex things through this idea of scripting. That we can tell it to do a bunch of order of things to do. And it can produce amazing results. And if you've never seen the ASCII Star Wars, we'll get to it at the very end where you can watch it online. Or just go to towel.lingonlight.net and tell them that. That's why I want to talk about this. This is why Bash makes me excited. It's because we can literally unlock our machines. So what are we talking about? We're talking about Bash. Bash the born-again shell. Why do we call the born-again shell? Because there's a guy named Stephen Born. And he used to work at Bell Labs. And they wrote a thing called Unix. Not the only version of Unix that existed in the universe. Unix stands for something. But Stephen was solving the fundamental problem of how do we move around files inside of Unix and evaluate them to do things. And about ten years later, nine years later, Richard Stallman said this should be open source and we're going to rewrite it under the GNU project. And Brian Fox, who lives up in Santa Barbara, I don't know if he still lives there, but he's from Santa Barbara, they rewrote shell. In honor of Stephen Born, who wrote the original, they called it the born-again shell. So that's where Bash comes from. And if you go to Wikipedia, it's going to give you this answer of what Bash does, which isn't wrong, it's totally the right answer, but it's too long, because this is really how you should think about Bash. Type commands do things. That's all Bash really does at its core. For those of you who are brand new to Bash, it's intimidating partially because you don't know how to use it, similarly to the way that a telegraph machine is intimidating. The underlying technology isn't dangerous or scary. We're going to send an electrical message from here to here. And on the other end, it will cause this action and they can write down what happened. That's not a crazy, weird idea, right? We can just send a message over a wire. Now, the code to head to it, that's a little confusing. Morse code, it's confusing to learn, but once you learn it, you can use it forever. Literally, it's been the same code for years and years and years. Turns out Alexa works the exact same way. Alexa for all it's do, does, all it's bells and whistles, if you go through the docs, eventually you get to a realization that all the box does is a really smart algorithm for natural language processing that writes down a text message and puts metadata around it based on where that device is located. So if I say, hey Alexa, where's the weather outside? It's going to write down that message and metadata and send it across the wire to a service. Now, that's kind of very complicated if you talk about lambda stack and things like that, serverless. But what the actual box gets back is a text message with metadata around it and it reads the text message to you and tells you the weather. And then you can do other things based on that metadata. But that's all Alexa does. It sends messages from point A to point B and leaves little files. And folders. Because that's at the end of the day what your computer really is, the giant pile of folders and files that get executed. That's it. Again, not a terrifying concept. Everybody that has a machine in front of them, who was not familiar with the concept of a file or a folder? We all are. Because it's fundamental to the way the machine works. All bash does is give you a much quicker, cleaner way to manipulate those things around that you can programmatically talk to. And then about 1992-93, there was a guy named Linus Torval who was working with a project, maybe you've heard of, called Linux. Linux became the default operating system for all the beige boxes in the world. So boxes that are off somewhere else running something else. Even Windows got on board with this recently and said, hey, if you're using Windows development version, you can just go ahead and run Linux because come on, that's what real developers use. Let's just put it there for you. Put whatever flavor you want. It's all ultimately the same thing. To get you, you can see tucks up there by a Windows terminal that's actually running Linux. It's ubiquitous. It's everywhere. Every machine you've probably ever touched probably has bash already in it because Linux is probably already there somewhere. And Linus Torval borrowed Stallman's project and said, this is the shell operating system we want for Linux. Bash became ubiquitous. That's why I'm teaching bash instead of the many other shells that got written. So I'm not going to talk about Z shell, C shell, C shell, and the zillion other shells you could run that all do the same basic thing. I'm talking about bash because it's ubiquitous. It's not just ubiquitous. It's how more complex things are being built because they're built out of this concept of Linux and these ideas of file systems. So who here is familiar with any of the stuff over there on the right? The CircleCI, Jenkins, CircleCI, or CI CD. All right, not many people in the room. These are build tools. These are services that perform actions that build, automate testing. The more complex your project, the more you're going to run into this stuff. So if you want to, every change you make on your code, go ahead and run this series of tests on it and then deploy the artifact that got built out of it being assembled to a target. Those are the tools that will let you do it. But essentially in their core it's just a machine you don't own that executes a bash script you wrote. So that world is really sealed off if you don't understand bash. The good news is bash is really straightforward to learn. And that's what we're going to spend the rest of today talking about. And at the end we'll get a little more tips and tricks of it and some advanced stuff. And then we'll open it up for what your favorite bash stuff is and what I might have forgotten. Because I am learning this as I go as well. We all are. For now Richard Stalman you probably don't know all the bash shortcut keys. So if you're on a Mac or a Linux box, guess what? You already have this. You don't have to do anything. Just open up a terminal. You're automatically in it. That's it. If you're on a Windows 10 box, professional edition, then jump into the Linux subsystem. If you have another Windows box just download git. Git gives you a really clean, simple minimized version of bash that you can do pretty much everything I'm going to show today with. So the rest of this talk is, well, these four areas of gaining and complexity of what it can do. There's some examples around it. And that's it.  Play along. Maybe learn some stuff. Who here thinks this is like an intimidating amount of information on a screen? You can raise your hand. It's fine. This is an intimidating amount of information on a screen. Absolutely.  If you know how to read this though this is all the information I wanted when I looked in this folder. All at one place at one time. It gives me a really good view as a developer what I'm doing. Let's talk about what's there. Because again this is a tutorial of how this works. Before that dollar sign, there's something that looks like this. On a Mac it defaults to this. Computer name, your current directory, your username, and then a dollar sign to tell you that's the prompt. That little tilde, it's actually kind of important. That tilde on a Mac in most Linux boxes will mean your home directory. If you just say where is home, it's a tilde. You'll see that in a lot of scripts. It's like you have a tilde there. Instead of dollar sign home means the same thing. Equivalence. But after the dollar sign is where we type the things. Let's start very simply. What I did is I went through all the manuals for all of these commands and we'll get to manuals later. I said what does the manual actually say this does? Then I said if I was going to turn this into Alexa command, how would I describe it? Except it says say in Alexa I say hey bash. So that's what literally I did for the whole rest of these slides. And then an example below of it actually running. So present working directory. We're going to step back just a little bit. The problem that Born was trying to solve is how do we move around and manipulate the files inside of Unix. It's all location based. So from bash's point of view PWD means where am I looking? Where is the current place that I am trying to manipulate space? What folder am I literally in? So a working directory is also a working folder interchangeable but PWD is the command. It tells me hey I'm in this long name of folder. LS I can say hey list the directory in this, list the contents of this directory. Same as opening a folder and seeing all the files in there. Except you can make it present a lot of additional information. Show all your hidden folders. One flag. And I realize right now it's like hey wait a minute what's a flag? This is always the point where someone starts getting nervous. Because yes there's a lot a lot a lot of flags. I used to say a zillion but that's not true. There's sometimes five, sometimes 40. But it's a limited number. And the nice thing is that bash is open source. I didn't really dwell on that earlier when I talked about Stallman and Brian Fox but this is important. It was written by people like you and me who believe in the open source concept that we should build tools and share them and share our knowledge. The entire reason we're at word camp, the reason you're in this room listening to me talk is to share information and knowledge and to get on the same page about all this.  Dot folder is a hidden folder. Like my get folder in this directory. I don't really need to see it all the time. It's there. It's important. But I don't need to see it all the time. It's hidden. Dot means I'm here. It's a recursive concept of here. And dot dot means one level up. Pretty straightforward once you get your head around it and you're like wow that's a lot of information really fast. And you're right it is. I don't have that much time today folks. That's why these slides are available online. You can play along at home as you need to. And for every command that exists, there's a manual for it. Already included. It works on an airplane. It works when you're completely offline. If you're really bored and you have no internet connection, this will still work. And it's really powerful information. Just say man and then whatever command. Even manual itself has a manual to tell you how to use it properly. Man LS, man PWD, all of them will get to a manual. They're fun to read. Again because they were written by people like you and me. All the jokes I put in here, there are jokes interwoven through the manuals. I'm not kidding. Like very smart logic, like our smart witticisms throughout it. Alright so we tell, see where we are. We see what's in the directory. Then we can change the directory and move around. Moved other directories. Specific directory. We can give it a full path and say move all the way over here. Move all the way back. Then we jump around. Pretty straightforward. Move one level up. That's what the dot dot means. We can make directories. Making new ones very easy. Make a dir. Make directory. Very straightforward. Make the new folder and put it exactly where I say. You can specify this to be very deep in the level or just some different computer somewhere else. Bash is powerful enough as long as the path is clear to do whatever you want. I'm going to speed up just a little bit on this part. Oh, what happened there? I don't know. Copy. Let's make a copy of this thing and put it somewhere else. Pretty powerful. You got a weird lag going on. I don't know. Move. Move is where I say move. It is. This is actually a really powerful command because it's not just move from point A to point B. It can be move from point A to point A and rename it along the path. So if you need to rename a bunch of things really fast, move from point A to point B. It lets you do that extremely fast without having to invoke some weird GUI tool. Remove. Oh, now that actually we're starting to get to a world where it might be a little dangerous. If you remove the wrong thing, bad things happen. But good thing is that RM is actually pretty benign on its own. You can remove individual files, but you can't remove the entire folders. To do that, you're going to have to start invoking flags. Again, I got this weird lag. RM minus startup is probably the most dangerous thing. It is recursive. Everything I can see and everything below this, that's what we're going to affect. And F means force. That's why it's shouting. Because it's not giving you an option. If you do this, it is gone. It is gone forever and you'll never get it back until you like do the time machine back up or you pull it down.  Or where you left off last time you saved and uploaded to Git or committed to Git. History? How are all my first scripts really like practical scripts where I looked at my history. If you're in a terminal, just go into terminal type history. See everything you've ever typed. And it will just be there. Those are fun functions for flipping coins that I was just experimenting with. It was the most efficient way to do it. It turns out the random is the shortest way I could figure out how to do it. Clear in the screen, I used this constantly in fact so much that I aliased it. And that actually leads me to my next section. It is very simple. Let's get rid of everything off the screen. Oh, and open. When you double mouse click a thing to open a thing on an icon, what you're actually telling the computer to do is interpret this mouse click on a graphical interface to go run open against the location of this application. You're literally using the command line at level abstracted. This is actually really important because how do you open Firefox? Let's probably search Firefox. How do you open Chrome? Maybe go click on the icon. How do you open Composer? You don't. You invoke it through the tool. Open lets you get to anything that has a GUI and open things that you're used to opening. This actually becomes really cool about what you can tie together things you can and can't see when we get to that later in scripting. I'm going to speed up just a little bit more. So that's the basic stuff, the very, very basic stuff. There's applications and tools because your computer can do a lot of things, maybe more things than you think it's capable of now. Remember that we have at our fingertips more processing power than we had on Earth for all of the Apollo missions combined. At your fingertips, if you have like a 2015 machine, you have more RAM than existed on the planet Earth before like 1980. And we all hide it behind GUIs. And we have these crazy powerful tools that have been existence for 40 years. Think about how good iOS has become since it was launched. Like how much better it got. That's just like a decade. Imagine 40 years with these low level tools that a lot of people hack on. So there's grep. General regular expression search. Grep is the most powerful search pattern matcher that's probably ever been made. If you know what you're doing with regular expressions, you can build crazy powerful tools that can find things instantaneously. The actual way I use it for real is I keep all of my notes for all the events I go to in text files on my machine. And I can jump into that folder and grep any keyword. If I remember a partial phrase from someone's talk, I can immediately find it. It takes me less time than it takes to open a web browser to find something of a talk I went to last year. Curl. Pull this all the way across the internet. That's what it means. Again, it has a lot of flags. A lot of options you can do with it. One of them that's super powerful is curl minus capital I, which inspects the header. Is anybody here regularly checking to see if their front end cache is working? Awesome. This is a faster way to do that. For those of you who don't, turn up a terminal and just run this. This will just run on almost every machine on earth. Against any website you want. It will tell you literally the header information, what computers are reading. And it will tell you an age of a cache if a cache exists. That's the way I primarily touch it. Eventually, you will run into the need to actually modify a file. Enter VI. One of the most powerful tools ever invented by mankind. And I see you not shaking your head. I used to be in that same boat because I actually quit them as this. This is true. It's the anti-user friendly text editor. But it's the most powerful text editor I've ever used. Once you get the hang of it, being able to just slash, type anything and jump to that line or copy like 50 lines at once or inner visual mode and just yank things around. It's super powerful. You can actually play this fun game. Do I have it open? I don't have it open anymore. It plays a super powerful fun game called VemAdventure that will teach you Vem through a Legend of Zelda type of adventure. And once you learn it, it's like, wow, I will never go. I quit using sublime text in favor of them. This is a true story. But if you're like, I don't want to learn a billion hot keys, there's nano. And if you just need to manipulate a file really quick while you're in a folder, just nano. Nano is another editor. That's literally why I get the name. But it's ubiquitous. I used Pico here. Pico is a clone of nano. If Pico doesn't work, nano will. And if nano doesn't work, Pico will. It depends on the flavor of whoever put that box together. And there's a lot more tools you can install. In fact, there are thousands, maybe millions of tools you can install that do a lot of cool things. If you're on Mac or Linux, you can use Brew or if you're on Linux, use Appget on Windows, I don't know what you'll do. But you'll probably get Linux at some point and then you just use Appget or homebrewworks. And a lot of times when I go to very technical talks, they'll talk about a tool. And the very first thing I try about going to look at the web page or anything, I'll just go in and say Brew install in the name of the thing. And that's how I download software. That's it. And it already installs it, sets it up, makes it ready to go. And I can just then type the name of that command and just start working on it. There's a Legend of Zelda game you can do with this. Actually, there's two. One's really, really fun. The other's really hard. DX and SD. SDX was the joke one. Calc. I use my computer to calculate things. I think we all do. But I really hate the layout of Calculator. I just hate it. It's like you've got to put this button. No, I just want to type a really long equation and have it spit out an answer. And that's calc. But it doesn't come in pre-installed. But again, Brew install calc, you're done. And this just works then from now on. Get. Probably didn't come with your machine. But get is the most powerful version control human beings have ever figured out. It's essential to do development in the modern world. It's essential to share your code in open source. And this is the easiest way we figured out how to do it.  That's not any way, shape, or form of commentary on it. At least not my commentary. And you can see exactly what has gone on in a project. But again, there's GUI's on top of this. But what the GUI does is just run these commands. So if you learn the commands, you don't need the GUI anymore. There's awesome tools like links, browser, DuckDuckGo, which is the command line tool. You want to look up the manual for something and not leave the terminal? Install DDR. DuckDuckGo or command line. And there's thousands more. Drush for Drupal, WPCLI, WordPress. And pretty much everything I've pointed to here. Composer, dependency management, tie things together. Behat for behavioral testing. Backstop for visual regression testing to see if pixels are the same pixel to pixel. Much better than human being can possibly do it. This found a problem when I updated PHP 7.3 recently that I visibly couldn't detect. But it said, hey, this is going to cause problems. It saw that there was enough of a problem. It was a pixel off and one thing that it made me start investigating and realize that I shouldn't go to 7.3 yet with my setup. I should fix that and then go to 7.3. But backstop let me do it. And thousands and thousands and thousands and more. More than you could probably ever install through GUI. And the weight on these things is very minimal. It does not slow down your machine. That's the kicker on all this. You can have a thousand command line tools waiting at your disposal. And you don't have to wait for them to open up. True story, there's one from image magic called convert. I can convert any image from any format to any other format in under a second just by typing what I want it to do. I don't have to open Photoshop. I don't have to mess around with a GUI. I don't have to pick a menu. I just say convert image with this extension to the image with this extension. Done. Just does it. Thousands more. All right. I'm literally out of time. But I haven't got another half of this to go. There's this ability in bash to do bash profiles. Bash RC is what it's called resource in Linux.  But only when I use you. So I can say, hey, when I type SL, I actually meant LS. When I type LA, I mean LA minus A. LS minus A. LX, same thing. Or something really long, like I want to open up Firefox, FF. It's faster than spotlight search because I'm always in the terminal myself. Or Weather Underground, which will get me to the Weather Underground. Is that really fun? Yes. Is it super practical? I don't know. But version master really is. That's 18 characters that don't have to type every time I do a git push. To save myself that much life. That adds up a lot over time. Setting paths in your thing, this just tells bash where to go look for that program. So very easy. If I don't like the type of command for something that doesn't work, you can just set a path for it and say, hey, all right, next time I type it, it's going to open that. But again, this is just for you. So bash your machine doesn't default to these things. It's just for you. It's a very safe way to do it. Again, this is more for the tutorial side of how to actually implement it. And then we get to the most powerful part about bash. Thank you. Scripting. This is the first script you're probably ever write. Hello world. But in this, we can learn so much. There's so much here that if you configure, if you understand what this says, there's nothing you can't do. I promise you. This is where everybody starts. So let's talk about what we're seeing on the screen. The very first line. So bash is for moving things around and then evaluating the files and what to do with them. The very first line bash encounters tells it what to do. So literally it's called the shebang, the hashtag bang. It says, hey, bash, after this, I'm going to tell you what program to use to execute whatever is in this file. It doesn't have to be bash. You can do this for a lot of things like Python, Ruby, it's how you set the top first line to tell bash what to do with it. What runtime environment to use. Just happens to be on my machine. Then bash is where bash lives. Then hashtags are the comments. After that first line, hashtags just mean ignore this. Don't worry about it. Call it with a shell name and you give it permissions to run. Shamad changed the file mode. This gets dangerous and weird because the first time you encounter it you're like, what on earth do I do with this? Just hit 755 and you're probably going to be okay. Then you'll figure out what that means over time. Or plus x. A plus x is what I use a lot. Again, no time today to get into really what that means. Then you just tell bash to evaluate that file. So you type dot which means present directory I'm in slash name of the file. If you want to invoke a file that's somewhere else on your machine, just tell bash the full name of that path so it can go evaluate the file that's at the end of that path. Then it will do whatever that file tells it to do. That's all scripting really does. You can build local bend folders so you can do things really fast. You don't have to write type SH or worry about how you're going to format the line. Just tell it, hey, if it's in here, evaluate it. I tested this earlier. I tested it earlier and then I didn't actually bother to make it big. Clear. Make it a little bigger. Well, live demos. They've got list list list which will take forever because I'm in a hurry. List list list is a real programmer in about once a week to check on the health status before websites that are run. I have machines that we'll get to later, other scripting. Tell you what, we'll come back and look at its output in a second. Instead of me waiting on a green screen. But it will just go through and look at use WPCLI to invoke across these four sites. I actually rewritten this lately to use another command so it's taking a little bit longer to actually pull the names of the sites from something else. But go give me a report. Again, these are real things I actually use in my real life. Open these Firefox windows to these addresses and then warm the caches on these two sites. For a demo I do, it's the weekly demo at 10 a.m. on Wednesdays in Pantheon. You want to build demo websites? I do a lot of those. One time I had to build 80 in a day and I was like, I can't build 80 in a day. That would take me forever. So I built a script to build me 80 in a day and this is the script. And you can go get it yourself and run the exact same thing I ran. How I actually post our content to my blog is I ship it to GitHub. My machine grabs it from GitHub. It pushes it onto my environment. B-hat tests it to make sure it does exactly what I wanted it to do and that the links didn't break. Then it ships it to my test environment. Test it with backstop to make sure it's pixel-to-pixel the same thing that configuration was the same between those two environments. If that all works, then let's ship the thing to production. Just a giant bash script. You can have it if you want. Or you want to know that your website got updated because a lot woke up once a week to go check and see if there was updates, update the site in a different environment, then run a bunch of tests against it and push to production if it all worked. These are real scripts. These are real scripts that I actually use on a regular basis. And, hmm, operation timeout. I think I'm on a port issue right now because I switched to Wi-Fi networks right before this. That's what I did. So that ran because of port issues. Anyway, but the rest of this is like, wow, that's the basics. If you understand those general concepts I said, there's the basic commands, there's tools you can use, there's aliases, and there's scripts, that's bash. There's nothing terrifying about that. But I asked the internet and it said, hey, where, hey, she's back there. What are some tips about this? And immediately, like I'm talking within a day, 30 people got back to me and said, hey, there's all these tips like it, you can autocomplete just by hitting tab. You can make aliases for things. You can type up to go to the back of your last commands. Because I'm still not evaluating that program and I can't get to it clearly. Yeah, here's all the commands I've run for a while. Get checkouts, NPMs, doing a lot of testing with NPM stuff. Control-A, to jump from the front and back of a line. So if I type there, control-A, control-A I can jump around. Yeah, exactly. I learned something, I learned so much doing this. Oh, the reverse command search. I'm not going to show it off, but check it out. You will love it. The Astro character, one of those powerful characters in all of bash. That's okay. Nope. Yeah, it's clear. And then she just, no, I'm doing this. An alias for changing the desktop. Oh yeah, so I got all these screen shots. I'm going to RM minus RF. The dangerous one, SCR. So everything that starts with SCR and then anything after it, I'm just going to remove, do another LS. All my screen shots are gone. Because I don't need them anymore because they're screen shots and I don't keep screen shots around. I don't need to. I just clean up work. But the Astro character, super powerful. That guy that supposedly just deleted his entire machine did an RM minus F with a root level against Astrox and it just wiped out everything. It didn't actually happen. Tab pipe, pipe. I didn't talk about pipe because I don't have time. But the most powerful thing about the scripting and why it won, why shell is the standard and why C shell didn't win, is you can take the output from one command and insert that output into anything else you have. Literally pipe it from here to here. So you can run programs that go programmatically, get information, pull it back into the program and then use that information to keep running the program. Nobody else had really figured that out before Steven born. But pipe, most important thing I think on that screen. If you are wanting a really cool bash profile out of the box, a lot of people have built them but this is probably my favorite and Ted brought it up as well so I put it in this deck. CD minus, CD minus is the last channel button. This saves you so much typing.  Just like that. Very simple. And then there's the advanced one where I told you in the beginning with a if statement. Because in scripts you can do logic, if statements, and wins, and loops. And things like that, not wins. Yeah, do wilds. You can set strict mode in bash. It's not official strict mode but still it says fail when anything bad happens. So you don't actually push to production something that will break and then not tell you it broke and then you figure out like a day later that you took down a rack of servers.  It's everywhere. It's literally every machine you've ever touched. Bash is probably in there somewhere. Don't be afraid of it. And you can Google anything. I like DuckDuckGo for documentation reasons. It's just a little bit better at finding actual docs I think. And it sounds good but I don't like the command line. I don't like typing things. Go to telehack. Telehack.com. This is still up and running from the Mountain View from Stanford down to Mountain View. Anyway, it's a terminal inside of your browser that you can play Zork, the original adventure game. It's an all text based game. It's print out primes, do cow say, figlet and all those other fun things. This is where you can watch Star Wars completely ASCII.  You can do anything in here and you're like oh that didn't blow up anything. Very safe. And there's thousands of guides. There's thousands of ways to learn this. And I'm happy to answer questions. Sorry I ran out of time for Q&A. I really would have hoped not to. But that's the whole time I got. I'm going to clap along with these guys. I think I'm going to now be out in the area over here by the surfboards and coffee to answer any of your all questions at the very end. Thanks.