Blog Archives

FastTasks – a utility for ten common terminal tasks

FastTasks

Update: I’ve since written a nice GUI version in AppleScript-ObjectiveC which you can download for free here»

If you find you only ever go into Terminal to perform a small number of tasks that can’t be done (easily or at all) in the OS X graphical user interface, this little utility could be for you. It allows you to run a number of common tasks such as

reveal and hide hidden folders
batch change the extension on multiple files
purge system free memory
flush the DNS cache
restore system preferences to defaults

without having to bother looking up the commands. You will, however, have to do a little Terminal ‘dirty work’ to initially get the utility up and running (it’s a shell script which you need to turn into an executable file), but step by step instructions are all provided. 😉

Here’s what you do:

1. Copy or download the entire script from here FastTasks code and paste it into a text editor (TextEdit or Tincta, my favourite, will do).

2. Save the file as plain text onto your desktop with the name ‘FastTasks’

3. Open Terminal.app and paste this command:

sudo chmod 755 ~/Desktop/FastTasks

and press ‘return’ on your keyboard. You’ll be asked for you Admin password which will be invisible when you type it. If you’re wondering what you’ve just done, you’ve just changed that plain text file into an executable program.

4. Paste the next line into Terminal.app

cp ~/Desktop/FastTasks /etc/bin/FastTasks

then press ‘return’ on your keyboard.

As a result of that last command, you can now use the script by typing ‘FastTasks’ in a Terminal window or by double-clicking ‘FastTasks’ in Finder or on the Desktop.

5. By the way, if the Terminal window remains open after FastTasks has completed, change the following settings in Terminal’s Preferences:

Preferences > Settings > Shell > When the shell exits…

and change the dropdown menu from ‘Don’t close the window’ to ‘Close if the shell exited cleanly’.

And that’s it. You can now run any of the tasks in the menu without having to know the commands! 🙂

Fast tips for using FastTasks

1. FastTasks is actually quickest to run by using Spotlight and Terminal.
If you have the Spotlight hotkey set up (usually cmd-space by default), simply open Spotlight, and type ‘Term’ and hit ‘return’ on the keyboard. At the Terminal prompt type ‘fasttasks’ and hit ‘return’.

2. Running it this way has another benefit. If you want to run FastTasks again after performing one task, just hit the ‘up’ arrow on the keyboard (hitting the ‘up’ arrow repeatedly will take you through previous commands entered at the Terminal prompt. Use the ‘down’ arrow to go forward), then ‘return’ when you see ‘fasttasks’ on the command line.

revealing the hidden Library

With OSX Lion, Apple decided to make the user Library folder a hidden item. If you don’t know what this folder is for or never use it, that’s probably a good thing. However, for many others, it’s a bit annoying. Here’s a couple of tips for viewing your hidden Library folder.

1. See it only when you need it
If you only need infrequent access to your user/library folder, you might as well leave it hidden and use the ‘Go’ menu in the Finder menubar to get to it.

Hold down the option key while viewing the Menu, and ‘Library’ will appear in the menu list. Release the option key and you’ll see it magically disappear.

2. Change its ‘hidden’ folder status
However, if you want to have your Library folder permanently visible, you need to change its ‘hidden’ status in Terminal.

To do that, open up the Terminal App (in Applications > Utilities) and copy/paste the following command:

chflags nohidden ~/Library

Then press ‘Return’ and quit Terminal. You should now see your Library appear in Finder when you view your Home/User folder.


%d bloggers like this: