Textfile On A Mac

How To Create A Text File On A Mac

Believe it or not, this is one of the most popular questions by which my blog is found by search engines. Also, for people coming from other operating systems, this is also one of the most important sources of frustration.

So, knowing that this particular topic is so hot, I thought it would be interesting to show you how to create a text file on Mac OS, this time without Quicksilver. For those of you who don’t kow the original post, here is a more detailed description of using Quicksilver for creating text files, prepending or appending text to them.

The trick is basically a linux shell hack, which any normal linux user knows, or used in his days. But Mac OS users are not like Linux users, like I learned after one of my most commented posts on digg, so here’s the simple trick:

1. Start Terminal. I have it in the dock, because I use it a lot, but this is not the default setup. For those of you who don’t know where to find it, try “Applications / Utilities”, you’ll find it there.

2. Change your folder to the desired location for your future text file, let’s say by:

cd /Users/yourusername/Desktop/

if you want to create the text file on your Desktop. Of course, change “yourusername” with your real username on that Mac.

3. Issue this simple command:

echo “this line created with terminal” > filename.txt

The part between quotes will be the first line of your file, and the name of your file will be filename.txt.

Simple as a Mac.

P.S. If you think this was actually too simple, think at how you can make it better by combining with Automator, as an intermediary shell action between two other commands. As a matter of fact, I’m just thinking right now of something like this. But more on that soon.

Running For My Life - from zero to ultramarathoner

The spooky thing about depression is that it sneaks in. There aren’t really trumpets and loud voices announcing: “Hail, hail, this is depression entering the room, all rise!” Nope. It’s slow, silent, creepy. It doesn’t even look like depression. It starts with small isolation thoughts like: “Maybe I shouldn’t get out today, I just don’t feel like going out”. And then it does the same next day. And then the day after that and so on. And then it starts to whisper louder and louder in your ears: “Why would you go outside, you loser? Didn’t have enough yet? Want more people to make fun of how much of a big, fat loser you are?”

And then you start to breath in guilt and shame, instead of air. Every breathe you take is putting more dark thoughts into your body.

Until you get stuck. You can’t move anymore. At all.

If you want to know how I got out of this space, eventually, check out my latest book on Amazon and Kindle.

Running For My Life -from zero to ultramarathoner

Dragos Roua

The guy who started all this. Entrepreneur, ultra-marathoner, tanguero, father and risk taker. I’m blogging here, but I also spend a lot of time in this marvelous space.. You’re invited, by the way.

This Post Has 9 Comments

  1. Already done, as you can see in the initial post. This is just another way to do it, there are a lot of situation when this simple thing called redirection can be handy, Automator being one of them. And I agree with you that with Quicksilver, if you only want to create a file and nothing more, it’s easier…

  2. I feel ignorant. I don’t know where to change the folder. When I typed in the cd/ thing, it said no such file or directory. I’m trying to convert a csv file to a .txt. I hate to give up and fire up my PC.

Leave a Reply

Your email address will not be published. Required fields are marked *

What is 5 + 10 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)