Tag Archives: Mac

Using rsync to download large files over ssh with resume option

In the last months I have been doing this a lot so it might be best to put it up here so I don’t have to google it every time. There is a lot of cool features to rsync. The one we will concentrate on here is the –partial option that lets us resume a broken download. Have to start over with the download of a large file can be a real pain

Basic syntax

rsync --partial --progress --rsh=ssh user@host:remote_file local_file

I also use the –progress option to output the progress of the download


rsync --partial --progress --rsh=ssh niklas@niklasottosson.com:.vimrc .

This will download the file ‘.vimrc’ from my home directory on niklasottosson.com and into the folder I’m currently in. If the download is interrupted rsync will keep the partial downloaded file and resume from it when the downloaded is started again

Tested on OSX 10.7.4 and rsync version 3.0.3

Check library information of a dylib file

There is a nifty command called “file” which will give you the architecture and type information about a library file.

file /usr/lib/libosg.3.0.1.dylib

Gives me the following information

libosg.3.0.1.dylib: Mach-O 64-bit dynamically linked shared library x86_64

This information is especially useful when searching for explanations to strange Xcode linker errors

Tested on OSX 10.6.8 and file v5.03

Taking screenshots in OSX

As a former windows geek I was a slave under the “print screen” button. On OSX things are a little different:

Take a screen shoot of the desktop:
This will put the screen shoot on your desktop in PNG format

Take a screen shoot of the desktop 2:
This will put the screen shoot into the clipboard

Define area for screen shoot:
This will turn your mouse pointer into a cross-hair. Us this to define an area on the screen. When you let go of the mouse button the screen shoot will be placed on the desktop as a PNG. If you want it on the clipboard instead just add the Control key

Take a screen shoot of a application window:
Command-Shift-4 + Spacebar
Your mouse pointer will now transform into a camera that will select whole windows. To take a picture of the selected window just press left mouse button and the picture will be placed on the desktop as a PNG. If you want it on the clipboard instead just add the Control key like this: Command-Control-Shift-4 + Spacebar

This was tested on OSX v10.6