Archive for September 22nd, 2014

mkdir

Well this is just a qick post as I’m sure everyone is aware of this trick. Well not everyone as I recently had aconversation with a colleauge over the quickest way to create nestled folders. My answer was open terminal and type your folder structure such as…

mkdir -p ~/folder/folder1/folder2/folder3

Just about as fast as it gets….

September 22, 2014 | By | Reply More

ditto

Another commandline gem is ditto (man ditto).

This command, called “ditto,” not only copies the files from the source directory to the destination directory, but creating the destination directory if it doesn’t already exist. It will also merge the contents of the source directory with the destination directory if it exists.

It will follow symbolic links and hard links when copying files and will also preserver permisions and metadata. Which comes in really handy if you are working on say the ‘User Template’ folder for example.

Runing ditto is a snap…

ditto ~/Documents/MyFolder ~/Desktop/MyNewFolder

That would copy MyFolder to the Desktop creating the MyNewFolder if it didn’t already exist.

If you would like to see the verbose output the simply add ‘-V’ before the source folder.

ditto -V ~/Documents/MyFolder ~/Desktop/MyNewFolder

If you need more info on other options again type man ditto.

September 22, 2014 | By | Reply More