Sometimes staying on top of the latest version of WordPress can be quite annoying when your testing things locally or rolling out regular wordpress sites. I normally install with .svn but this is a neat little bash script function I threw together to grab the latest version of WordPress and unzip into the current directory through Mac OS X Terminal command.
Now quit and re-open terminal or type ./profile for the changes to take effect.
CD into the desired directory and type wp-install and let magic behold you, you’ll shortly have the latest version of WordPress downloaded and installed.
In addition to my last post which was how to show line numbers in Vim I soon after wanted to find a way to jump to the line number I knew I needed to edit.
Using a combination of grep -n “blah blah” file.txt which will return the string if found and the line numbers that it was found on.
Armed with the line number from grep I soon found a way to jump to line number in vim.
Simply do the following.
:956 + enter (obviously replacing 956 with whatever your line number is)
And that’s all there is to it.
You can jump to the beginning and end of files as well by simply Hitting G.
If you’ve always wondered if it would be cool to be able to type your own custom command into mac terminal and have it do whatever wonderful command thing, you can conjure up in your wonderfully creative head.
Then i’m afraid to say it’s just not possible…ha…only kidding…keep reading if you want to find out how, it’s actually really quite simple.
So to setup these ultra cool, simple shortcut commands for your mac terminal you need to locate or create a .profile file.
If you have one already you’ll be able to find it using the following commands.
cd ~/
ls -f
This either will or won’t reveal a .profile file. If it doesn’t, no sweat, we’ll just go ahead and create it.
mate ~/.profile
(note i’m using Textmate here, you could use vim / nano or whatever gui takes your fancy.)
Once you’ve got this file open we’re going to use alias to define our shortcuts.
Here’s an example.
alias davetest="cd /Applications/MAMP/htdocs/davetestsite/"
Save the file, relaunch terminal and type “davetest” or whatever your shortcut is and wollah you’ll have created your very own customised mac terminal shortcut command.