Mike's Home Page

Personal Page of Mike Williams

Shell tips

Shell tips:

Rapidly search files for a string for the extremely lazy (put in ~/.bashrc):

alias flgrep='find . | xargs grep '

Find and replace typos in files rapidly:

for i in `flgrep Recieve | cut -d: -f1`; do sed -i 's/Recieve/Receive/g' $i; done

Be sure to replace the cut setup with however your files are formatted to get just the file name.


Maintaining custom branches against a stable kernel

Assuming you’ve already cloned the kernel, done some work, and fetched the remote updates and tags:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
cd linux-2.6
git fetch --tags
git fetch

You can then rebase custom branches against kernel releases such as v2.6.38 using the following:

git checkout master
git rebase v2.6.38
git checkout your_custom_branch
git rebase master

However, for development based on a stable version you will most likely want the most recent version of that stable kernel, such as v2.6.38.7. To do so, fetch the tags for that version and use it to rebase:

git fetch --tagsĀ git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.38.y.git
git checkout master
git rebase v2.6.38.7
git checkout your_custom_branch
git rebase master