How I Use the Shell

I am by no means a master at programming the shell. I'm not even sure my skills would be considered novice. However, even with just a few commands, the Terminal/Unix Shell of the Mac can be an incredibly powerful tool. Things get more exciting when you couple it with Keyboard Maestro. A few of my most common shell commands include grep, split,find, mv,cp cat, wc, head, tail and rsync. Even with just these few you can perform some very clever tricks and save yourself a ton of time. Grep is used to find text within a text file. That may not sound like much until you try it with a .CSV file that's 1.5GB in size. Go ahead and look for a customer, SKU, or phone number in that mess. With grep it's light work and results can be piped off into a much smaller file you can open. In fact, grep was my re-introduction to the Shell when using […]

Creating a new or blank folder structure from a text file

While cleaning up and organizing my drives, I ran into a situation where I wanted to replicate a folder structure, but not copy any of the files. I'm going to move the files to a new location, but want to keep working and not wait for the folders to copy. Turns out there are a couple of easy ways to accomplish this. For the first method, create the directory structure you want using a plain text editor. This would be done by creating the path to lowest level folder you may need. You don't need to list all the interim directories. If I were to list: "Game Folder/Assets/Icons" it would make all three folders. If the folder name contains spaces, enclose the entire line in quotes. This is a great way to create the same folder structure over an over again for something like a website or coding project. Next, open Terminal, switch to the new Parent folder where you […]