# The Life-Changing Magic of Markdown ![](https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/175px-Markdown-mark.svg.png) I started using Markdown in 2009, shortly after I became a full-time work-for-hire digital publisher. A large part of publishing is formatting documents. Often, I have to assimilate content from many different sources. And all those different programs bring along formatting gremlins that made my job extremely frustrating. Macs and PCs are notoriously incompatible when it comes to word processors. Sometimes, the best solution to getting a document properly formatted is to 'go nuclear' and strip out all the formatting using a plain text editor (like notepad). However, notepad is not ideal for large documents and it drove me to find more robust plain text editors (like [atom](https://pubwriter.com/tutorials/atom) - the most powerful text editor on the planet that is also **FREE**). Once you start working in the world of plain text, it won't be long before you'll likely come across markdown. And what you'll love about plain text is the speed at which you can work, unmarred by distraction. I bet the rise of 'distraction-free' editors is where a lot of markdown fans like myself first discovered it. If you are a writer, and you know about [Grammarly](https://grammarly.go2cloud.org/aff_c?offer_id=209&aff_id=14511) - you know that starting without any formatting is the best way to go. ## What is markdown? Markdown is how you format your text for publishing to a static site generator like [PubWriter](https://www.pubwriter.com). You can add italics, bold, images, headers, dividers, and more. In case you wondered, the page you are ready **right now** was created in markdown (and if you are curious what the source txt file looks like [click here](https://dl.dropboxusercontent.com/s/91mduwz59d1pro2/markdown.md)). Markdown is a [semantic editor(https://en.wikipedia.org/wiki/Semantic_publishing). Some helpful (& recommended) tutorials to start with: - [Learn Markdown in 60 seconds](http://commonmark.org/help/) - [A 10 minute interactive tutorial](http://commonmark.org/help/tutorial/) - [What is Markdown?](http://whatismarkdown.com/) PubWriter leverages markdown for the 'semantic formatting' to trigger how the text you write is rendered on your website (in html). The beauty of writing semantically is that your text is 'jailbroken' and compatible with any program you may elect to use in the future. The problem of writing in Word, Pages, Open Office, or any other word processor is that your document will contain proprietary formatting unique to the application you built it with. This means unless the user has the same program as you do, you can't necessarily open it edit it. Whenever you see .md on a filename, it means it was saved in markdown. There are dozens of markdown editors and more are released every year. They are lightweight applications that run on any OS. The best part is that the .md file you create will be compatible with all of them! There are some powerful things you can do with Markdown files that simply can't be done with proprietary programs like word or pages. For example you can... * Combine multiple markdown files into one. * Magically sort the lines of multiple files into one. How to combine multiple .md files into one MD file. First, copy all the .md files you want to combine into a single directory. Next, open a Terminal (mac) and find the directory where the .md files you want to combine reside. Tip: use the 'Open Here in Terminal' trick explained here. Next, run this command in terminal: cat *.md >merged.md If you want to alphabetically sort every line in a new file: cat *.md | sort > merged1.md ## Advanced users You can use the ls command to confirm all the files you want to combine are in the same directory. cd = change directory cd \ = takes you to the top directory cd .. = goes up one level cd ~ = takes you to your home directory Caution! This step will take ALL the md files on your computer and merge them into a single file - not sure why you would ever want to do this! Use this command to combine all the files into one: find /temp -name '*.md' -exec cat {} \; > all.md find . -name '*.md' -exec cat {} \; > all.md find . -name '*.txt' -exec cat {} \; > allTheFiles.txt