Archive for August, 2014

Testing 1…2…3

Ignore this. I’m just testing a blogging client on my iPad.

August 24, 2014 | By | Reply More

The missing back button

One of my biggest annoyances of using Safari is the lack of a keyboard button taking me back to the previous page.

The below pasted in to terminal will fix that issue and assign the ‘delete’ as you keyboard back button once again.

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool YES

Apple please make this the default again.

August 13, 2014 | By | Reply More

Is there a file in that folder?

If you need a script to find if there is a file in a folder or perhaps you are checking for the existence of a file in a specific location.



#!/bin/bash
FILE=”/DIRECTORY/FILENAME”
if [ -f $FILE]; then
echo “Yep that file is there
else
echo “Oh no file with that name found”
fi
exit

Sorted.

August 12, 2014 | By | Reply More

is that directory empty?

I needed a quick and dirty way to find if the contents of a directory is empty. I’m not interested in th hidden files only files or orther directories within. Here is the bash script i knocked up to do the check…

#!/bin/bash
DIRECTORY=“/SOMEWHERE/”
if[ “$(ls -A $DIRECTORY)”]; then
echo”$DIRECTORY is not empty!”
else
echo”$DIRECTORY is empty!”
fi
exit

Job done.

August 8, 2014 | By | Reply More