Unix tips du jour
November 24, 2011programming unix bash
The thing about unix tools is they are incredibly hard to learn. Even if you understand a tool, you need to build it into your workflow, which takes serious time and experience. Here's just a quick intro into 2 simple ones, and one complex one for you to chew on:
fc
fc opens the last ran command in your text editor, then runs it after you save.
It's nice when you make a mistake.
ctrl-r
Search your last ran commands. Just try it.
rsync
This one is really scary.
You probably already know this one, it just syncs a remote directory. A great use-case for web developers is when you have a server up and running, and want to change say, an HTML file, you can use rsync on the folder and will update just what has changed.
It is complicated, but VERY good. If you have a server you want to attempt to update with local files (and if you're a web developer you probably do), YOU NEED THIS.
Spend 30 minutes reading the man page and you'll thank me later.
It's a bitch to learn and work into your workflow, and you won't understand the rsync string you wrote, but you'll be in love anyways.
Besides, you can always just fc your rsync command to save it as a script and you only need to make it once!
- xxx
