TagUnix

How To Add Cron or Cron-like Jobs To Mac (With MAMP or Otherwise)

H

The Mac runs on Unix, which makes it incredibly powerful. You might be running MAMP or a stand-alone version of Apache, and one of the things that you might want to run is cron, which is a scheduling tool. Instead of cron though, you could actually have your Mac just run a launch daemon. Just go to terminal, and type: cd /Library/LaunchDaemons/ Now type: sudo vim yourfile.cron.plist You’ll...

How To Find The Location Of An Executable Program In The Mac Terminal

H

The Mac platform is amazing, and what makes it even more powerful is that it’s running on Unix, so you have the incredible power of bash and the shell terminal at your disposal. For instance, what takes 5 clicks and 30 minutes of your time might just be solved by running one command in Terminal – and that’s underestimating it. Take for instance, this scenario: Sometimes...

How To Make and Run Batch Files In Terminal In Mac OSX

H

I use batch files sometimes when I was using Windows because it saves a lot of time when you need to run a batch of commands frequently. With a batch file, you save all the commands into one file, and just run the batch file, instead of your gazillion commands individually. I was facing the same situation in Mac OSX when I realised that I didn’t know how to create a batch file in Mac OSX...

Recursively Delete Selected Files or Folders In Windows

R

I was looking around for a way to recursively delete files and folders of a specific name in Windows. For example, imagine having “/folderA/folderB/file1.doc” and “/folderA/folderC/file1.doc”, and I wanted to remove all instances of file1.doc. Now imagine this file1.doc being presented in hundreds of folders. Deleting each file manually would drive anyone crazy. I know...

How do I create and remove a symbolic link?

H

I was fiddling around with symbolic links in my unix box and realised how cool they were. Basically symbolic links (or symlinks) create a virtual copy of the master file. This virtual copy has almost 100% of the master’s functionalities and characteristics (you’ll need to play around with the owner and file permissions sometimes though), and the really good thing about symlinks is...

Recursively Download Folders using FTP with wget in UNIX (even SSH)

R

Okay, so you don’t have SSH access to your server, but you do have FTP access to it, and you need *all* the files in a folder. Worse, your directory structure is many levels deep, and extremely messy. Normal FTP won’t cut it, because command-line FTP doesn’t do recursive downloading of folders. Turning off interactive mode and using mget doesn’t work too. The easiest...

Running UNIX commands in your Java application

R

I was looking around for a method to run commands from the prompt automatically from within my Java application, and then I found it. Here’s the solution – and it works like a charm!
static void doExec1() throws IOException {
// use pipes and I/O redirection
// but without using a shell
Runtime runtime = Runtime.getRuntime();
runtime.exec(“ls | wc >out1”);
}

About Author

I've over 17 years of entrepreneurship experience, having built a tech company to be the top in the country, which was subsequently acquired for an 8-figure sum. As CEO, I led the company through robust growth to 150 employees across 4 countries. After the acquisition, I embraced minimalism, sold off my personal possessions, and started living around the world.

Read more about my story here.